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 :
Microsoft Dynamics AX (Archived)

Using the Customer Cross Reference in Sales Order Entry Lines

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Fredrik Sætre Profile Picture
    12,644 on at

    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.

  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    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.

  • Community Member Profile Picture
    on at

    Wow.  You would think this would be standard in AX-12. Yes, I would take the code sample(s).  Thanks for your help

  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    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.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans