I'm currenty trying to write a little piece of code which deletes all delivery logs that are linked to a cancelled delivery (or in some situations deliviers in "stop requested" state). The code first loads all delivieres which are in the specified states.
After that, I want to load all delivery logs which are linked to those deliveries (OT: I'm currently doing this by using 2 different database queries, because I don't know how to select data from 2 linked tabled with the xtk.queryDef, maybe somebody can give me some advises with this problem as well).
The problem with this is, that I can't query the foreign key in the schema "nms:broadlogrcp". The schema documentation tells me, that there is a foreign key called iDeliveryId. but when I try to use it in the xtk.queryDef (@deliveryID ??), I get an error that this field is unknown.
Unfortunately, I still have a problem regarding the DeliveryID. It stills gives me an error that "expr="@delivery-id" (Line no. 7 in your example) is unknown. It looks like that there is no way to access this foreign key inside the broadLogs.
I found out about a "sqlExec" method. It's probably not the best way to use direkt sql statements instead of the API methods, but currently I can't find a better way.