Hi,
I've read a few posts about SysMultiTableLookup class but I don't appear to have it in AX 2012 R2.
Is this only available in a certain build?
Could someone send me an xpo with the class or post the code for it so I can copy it as I require it for a complex lookup override.
Thanks
*This post is locked for comments
Just found this post while replying on another thread.
Here's the original blog post of mine about this class, the guy in the other blog post is a shameless copy/paster :(
kashperuk.blogspot.dk/.../sysmultitableloookup-dynamic-lookups.html
I came across this article on a post elsewhere - I have employed this mechanism to achieve what I need - it is actually very easy to do and makes sense.
It is actually very easy to combine multiple datasources in a sysTableLookup. Here is the trick I used to be able to filter on the name from the EcoResProductTranslation in the lookup for items.
1) Create a view that combines all your datasources and add the fields you would like to see in your lookup to the view.
2) Create a query from the view created in step 1.
3) Use these to perform your lookup as follows...
static client void lookupItemActive(FormStringControl _ctrl)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(<ViewName>),_ctrl);
Query query = new Query(queryStr(<QueryName>));
sysTableLookup.addLookupfield(fieldnum(<ViewName>, ItemId));
sysTableLookup.addLookupfield(fieldNum(<ViewName>, Name));
sysTableLookup.addLookupfield(fieldNum(<ViewName>, ItemGroupId));
sysTableLookup.addLookupfield(fieldnum(<ViewName>, Status));
sysTableLookup.addLookupfield(fieldnum(<ViewName>, RevId));
sysTableLookup.addLookupfield(fieldnum(<ViewName>, ItemType));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
Thanks for clarifying this for me Stephan, I thought I was going mad when I couldn't find it in the AOT, despite some forum posts mentioning it.
In addition to this, I am trying to override the customer lookup on the SalesCreateOrder form, I had presumed this is controlled by the form CustTableLookup but this doesn't seem to be the case, could you direct me on how this lookup is controlled?
I would simply override the code on the form, but when I add in the tableMethodStr name to return the customer name, I get a blank value.
Using:
SysTableLookup.lookupMethod(tableMethodStr(CustTable,Name));
Hoping to return the customer name by using the name display method against the CustTable
Hi,
I think this class is not standard in AX 2012 -> I have also downloaded this class as an xpo an made a few corretions in the code.
Here's a link where you can download the class:
http://axbooster.blogspot.co.at/2014/05/lookup-from-multiple-table-ax-2009.html
Regards
Stefan
I cannot find it in fully patched R1,R2 or R3.
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,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156