Hello.
I've created a custom maximo-datasource for the TECHMOBILE application which I'm trying to filter using a dynamic query but I'm currently having an issue.
Here's the datasource:
<maximo-datasource id="cnewDs" object-name="NEWOBJ" object-structure="NEWOBJ" cache-expiry-ms="1" where="relname.wonum="{page.params.wonum}"" selection-mode="none">
<schema id="nrfqz1">
<attribute name="newobjid" id="nyawd3" unique-id="true"/>
<attribute name="attr1" searchable="true" id="fg2qx3"/>
<attribute name="attr2" id="ynf473" searchable="true"/>
<attribute name="relname" id="ssadsa">
<attribute name="wonum" searchable="true" id="fa2das"/>
</attribute>
</schema>
</maximo-datasource>
This datasource is used in a data-list which is in a drawer, that can be opened via a custom button. The relationship relname is a 1:N relationship which relates my custom object to the workorder.
Now whenever I open the dialog for the very first time, the "where" clause is applied and everything works fine. But if I open the dialog in another workorder, I'm still seeing the old records as if the old filter is still applied.
I've tried removing the "where" clause and using some custom code in the AppCustomization.js, before opening the dialog:
let MainDs = this.app.findDatasource('cnewDs');
await MainDs.clearState();
await MainDs.resetState();
await MainDs.initializeQbe();
MainDs.setQBE("relname.wonum","=",wonum);
await MainDs.searchQBE();
but the QBE filter isnt working either (if I remove the "where" parameter from the datasource, 0 objects are returned).
I've tried using the rel.relname notation for the wonum attribute in the datasource but it's not working either. Also the forceReload() isn't returning the correct rows of the datasource. In the MAF preview environment it works fine anyway.
How am I supposed to apply this kind of filter (which works smoothly with another datasource - very similar setting, only difference is that the relationship has a 1:1 cardinality)?
Thank you.