Notifications
Announcements
No record found.
We are trying to find where you can add a sales order line by the customer's cross reference number. Does anyone have a how to? Or can point me in the correct direction?
Thanks,
Bryan
*This post is locked for comments
There is an alias function in the lookup fields. For instance, you can enter the item id or the search name (inventtable.namealias) to look up an item. I bet that this could be extended some how.
Unfortunately the item alias is not customer specific.
I can suggest some code samples on how to achieve what you want, if you're interested. It's also popular to expand the lookup (drop down) on the Item number field to be smarter and include multiple tabs, i.e. Items purchased by the customer, Items with trade agreements for the customer, Items with external item descriptions, etc., as a means of helping the user select appropriate items given the customer as context.
Wow. You would think this would be standard in AX-12. Yes, I would take the code sample(s). Thanks for your help
Here is some proof of concept code.
On form SalesTable, on the SalesLine data source, on the ExternalItemId field, override method modified as follows. Note that in this example a check should be made for SalesLine.RecId, since it should NEVER be allowed to change the ItemId on a SalesLine record that has been saved to the database, only one that is not yet saved.
public void modified() { CustVendExternalItem custVendExternalItem; ; super(); if (SalesLine.ExternalItemId) { if (!SalesLine.ItemId) { custVendExternalItem = CustVendExternalItem::findExternalItemId( ModuleInventPurchSalesVendCustGroup::Cust, SalesTable.CustAccount, SalesLine.ExternalItemId); if (!custVendExternalItem.RecId) { custVendExternalItem = CustVendExternalItem::findExternalItemId( ModuleInventPurchSalesVendCustGroup::CustGroup, SalesTable.custTable_CustAccount().CustItemGroupId, SalesLine.ExternalItemId); } if (custVendExternalItem.RecId) { SalesLine.ItemId = custVendExternalItem.ItemId; SalesLine.ExternalItemId = custVendExternalItem.ExternalItemId; SalesLine_ds.object(fieldNum(SalesLine, ItemId)).modified(); } } } }
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2