web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Is it possible to change the order when create SysTableLookup?

(0) ShareShare
ReportReport
Posted on by

I am trying to overwrite the lookup() method of a string field on a datasource.

Here is the code

SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(PurchLine), _lookupCtrl);

Query query = new Query();
QueryBuildDataSource queryBuildDataSourceLine = query.addDataSource(tableNum(PurchLine));
queryBuildDataSourceLine.addRange(fieldNum(PurchLine, isDeleted)).value(queryValue(NoYes::No));
sysTableLookup.parmQuery(query);

sysTableLookup.addLookupfield(fieldNum(PurchLine, PurchId));
sysTableLookup.addLookupfield(fieldNum(PurchLine, InventTransId), true);
sysTableLookup.addLookupfield(fieldNum(PurchLine, ItemId));

sysTableLookup.performFormLookup();

Hopefully, I want to make the order of columns is: purchId -> InventTransId -> ItemId, this is the default order if calling super() method.

But actually, the order is: InventTransId -> PurchId -> ItemId.

Seems like it put the returnItem to the first place by default.

So my question is that is it possible to change the order when create SysTableLookup?

Or I should create a lookup form instead of using SysTableLookup?

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Kai, I think its because you have set returnItem parameter true for InventTransId. Try removing True Parameter. If you want to return InventTransId but need that field sequence then you can try creating lookup form.

    sysTableLookup.addLookupfield(fieldNum(PurchLine, InventTransId), true);

  • Suggested answer
    Kai Cheng Profile Picture
    on at
    Finally, I have to create a new form to follow the original format of dialog. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans