How to use EntityLogItem in cuba 7.x?

I noticed that the latest document still use dsContext to get EntityLogItem list.

https://doc.cuba-platform.com/manual-latest/entity_log_view.html

The old code not work under cuba 7.x.

Why do you think it doesn’t work?

The existing example will work for legacy screens.
I’ve created an issue to update the docs for using the new data components.

I got the reason.

Because my entity extends by BaseIntIdentityIdEntity, the origin sql working under cuba 6.x is

select i from sec$EntityLog i
where i.entity = 'x$Pile' 
and i.entityRef.intEntityId = :ds$pileDs
order by i.eventTs desc

when i upgrade to 7.x, because the :ds$pileDs becomes an object instead of id, so the sql will be change like this,

select i from sec$EntityLog i
where i.entity = 'x$Pile' 
and i.entityRef.intEntityId = :ds$pileDs.id
order by i.eventTs desc

it works now.

1 Like