Hi,
How can I get the list of vendors whose record type is person through X++ ?
Thanks
*This post is locked for comments
You are welcome!
thank you so much Rustem
You should write something like this (example of lookup() method on form control):
public void lookup() { Query query; QueryBuildDataSource qbds, qbds2; SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(VendTable), this); query = new Query(); qbds = query.addDataSource(tableNum(VendTable)); qbds2 = qbds.addDataSource(tableNum(DirPerson)); qbds2.addLink(fieldNum(DirPerson, RecId), fieldNum(VendTable, Party)); qbds2.joinMode(JoinMode::ExistsJoin); sysTableLookup.addLookupfield(fieldnum(VendTable, AccountNum), true); sysTableLookup.addLookupMethod(tableMethodStr(VendTable, Name)); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); }
Thank you Rustem,
how can i adapt this job to make a lookup containing the vendors whose record type is person ?
Hi DJosef!
You should join DirPerson table to VendTable:
static void Job211(Args _args) { VendTable vendTable; DirPerson dirPerson; while select vendTable exists join dirPerson where dirPerson.RecId == vendTable.Party { info(vendTable.name()); } }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156