Hi D365 folks.
I am trying to add additional field as a lookup from customer account lookup when creating a new sales order. Currently, when typing something from the customer account field without hitting the arrow for dropdown and it can't find a specific customer account based on the keyword, it will proceed on searching for the customer name.
Now, we need to add a new field so that when the keyword entered can't be found from the customer account and customer name, it should be able to search for another field which in my case, the search name. I already checked everything I think, but no luck. I can't use lookup CoC or event handler since lookup comes first before the modify event. Any who knows how to attain this feature? Which class or form setup to check or customize?
Name alias is already on the CustTableLookup form. I tried moving it right below the the AccountNum, still not working. I'll tell the users. Thanks a lot, Girish!
I think this cannot be possible. Have you tried adding the NameAlias to the lookup field and check?
Thanks,
Girish S.
Hi Girish,
I wanted to add NameAlias from DirPartyTable. Are you referring to the first index of the CustTable and DirPartyTable? Only these two index fields will appear on the lookup?
Yeah, now I understood what you are asking.
I don't think this is achievable. You can either filter by customer account or customer name - You cannot add third one. In CustTable you can select either by index field CustAccount or Name - You cannot add fields other than that I guess.
Can I know which field you are trying to add?
Thanks,
Girish S.
Hi Girish,
When entering a text from the customer account account field when creating a new sales order for instance without hitting the v icon to perform a lookup, for example the "test2" on my second screenshot, the lookup will automatically appear and search for the customer account. Then if there is no "test2" from the customer account, it will now then proceed to look for "test2" from the customer name (second screenshot). Now we need to add additional logic to look for a third field if there is no "test2" from customer account and name. Maybe search name. I can't find which form settings or code the logic takes place for me to add my logic. Hoping that you can help me find which approach to take. Thanks!
I am not able to understand the issue. Lookup method won't give the value entered in the lookup control. In fact, as you said it's too early to get the value of lookup control in COC or event handler.
Can you elaborate more please?
Thanks,
Girish S.
Thanks, Girish! I already tried that approach. The problem is, lookup event comes first before the modify/modified event. So when I'm doing CoC or event handler on the lookup, I don't have the latest value input from the customer account field yet. Example, if I write "Test" and do my logic in the lookup, there will be no value on that field yet and it will show empty ("") string instead of "Test" which is the desired value from the user. I duplicated the CustTableLookup and assigned it to the CustAccount EDT I extended and play from there, but I can't see any lead.
Hi LexJann,
You need to add Lookup event handler and cancel the standard lookup by cancelling the super call.
Thanks,
Girish S.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156