Hi all
Has anyone else encountered this problem?
I am adding a custom page to a model driven app to be called the from command bar. During the call, the current record id is passed as a parameter. Typically, you would then write Power FX code like this to retrieve the record:
Set( varRecord,Lookup(‘<table>’, Id=Param(recordID));
This works perfectly fine as long the user is online but as soon as the user is assigned an offline profile it fails returning a random record. Some testing has revealed that “Lookup” returns the “first” record in the <table> ignoring the filter condition altogether. A similar problem can be observed for the “Search” command which returns all records in the offline table once again ignoring the filtering condition. My current workaround is to write the above code like this:
ClearCollect(colRecords,Filter(‘<table’, Id=Param(recordID));
Set( varRecord,Lookup(colRecords, Id=Param(recordID));
which works for users with or without an assigned offline profile. The purpose of the filter command is just to restrict the number of records retrieved for users without an offline profile.
Is this a possible bug in the implementation of the Lookup and Filter commands with respect to offline profiles, or just a coding error on my behalf?
Best, Steen

Report
All responses (
Answers (