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)

Inventory dimension identification not specified - Creating Sales Order - AIF

(0) ShareShare
ReportReport
Posted on by

Hello all,

I am creating sales order using AIF. I faced many issues which were solved with your help and assistance in one of my other forum post.

Currently I am facing following exception/error in Exception section System Administration -> Periodic -> Service and Application Integration Framework -> Exceptions

I even tried using different (multiple) InventDimId from INVENTDIM table (for SalesLine table) but still getting the same issue.

Here is the code I am using (Screenshot)

7774.error.jpg

Please, if anyone can help?

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Please give details of exception you are getting. Also try to assign  inventdim ID  in the following way .

    inventDim = salesLine.inventDim();
    inventDim.InventSiteId = "01";

    if you have warehouse and other inventory dimensions then you should specify those

    e.g  inventDim.InventLocationId = "99";

    salesLine.setInventDimIdFromInventDim(inventDim);

  • Community Member Profile Picture
    on at

    When I used 

    inventDim = salesLine.inventDim();

    I got the compiler error 

    Non-invocable member "inventDim" cannot be used like a method.

    Moreover setInventDimIdFromInventDim method is not available for salesLine.

    I am using MS Dynamics AX 2012.

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    try this for invent dim creation but you didn't tell in your post what exception you are getting.

    AxdEntity_InventDim inventDim = new AxdEntity_InventDim();
    
    inventDim.InventSiteId = "1";
    
    inventDim.InventLocationId = "2";
    
    salesLine.InventDim = new AxdEntity_InventDim[1] { inventDim };
    
    salesTable.SalesLine = new AxdEntity_SalesLine[1] { salesLine };
    
    salesOrder.SalesTable = new AxdEntity_SalesTable[1] { salesTable };
    
  • Community Member Profile Picture
    on at

    Thanks for the detailed reply.

    I tried this but now I am getting following 2 exceptions

    Error found when validating record.

    Update has been canceled.

    Here is screenshot of my exception window. (I am ignoring Warnings at the moment and focusing on errors only).

    6765.error.jpg

    None of these warning or error was there before using your code. Also I made sure that I am using correct SiteId and LocationId from InventDim table.  I even tried using inventDim.InventDimId="XXXXXXX"; but same warninngs and errors.

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Ok .Look at below code and see what you are missing. This code works. not sure what you are doing wrong.

    SalesOrderServiceClient proxy = new SalesOrderServiceClient();
    
    AxdEntityKey_LogisticsPostalAddress addressKey;
    
    CallContext _callContext = new CallContext();
    _callContext.Company = "comp1";
    
    AxdSalesOrder salesOrder = new AxdSalesOrder();
    
    AxdEntity_SalesTable salesTable = new AxdEntity_SalesTable();
    salesTable.CurrencyCode = "USD";
    salesTable.CustAccount = "US01";
    salesTable.DeliveryDate = Convert.ToDateTime("8/14/2016");
    salesTable.ReceiptDateRequested = Convert.ToDateTime("8/14/2016");
    salesTable.Payment = "Net1";
    salesTable.PurchOrderFormNum = "PO";
    
    AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine();
    salesLine.ItemId = "item1";
    salesLine.SalesQty = 1;
    salesLine.SalesUnit = "ea";
    
    AxdEntity_InventDim inventDim = new AxdEntity_InventDim();
    inventDim.InventSiteId = "1";
    inventDim.InventLocationId = "2";
    
    salesLine.InventDim = new AxdEntity_InventDim[1] { inventDim };
    salesTable.SalesLine = new AxdEntity_SalesLine[1] { salesLine };
    salesOrder.SalesTable = new AxdEntity_SalesTable[1] { salesTable };
    
    EntityKey[] returnedSalesOrderEntityKey = proxy.create(_callContext, salesOrder);
    
    EntityKey returnedSalesOrder = (EntityKey)returnedSalesOrderEntityKey.GetValue(0);
    Console.WriteLine("The sales order created has a Sales ID of " + returnedSalesOrder.KeyData[0].Value);
    Console.ReadLine();
  • Community Member Profile Picture
    on at

    I am using  your code, just have replaced

    1. Company with my company
    2. CustAccount to one of my customer account.
    3. Delivery Date and Receipt Date Requested to a future date
    4. Payment to a record of my system (N30)
    5. InventDimID, Location ID and Site id for InventDim to an existing record of my database.
    6. ItemID to an actual ID

    But still I am getting above errors and warnings. What can be a work around. How can I troubleshoot. How can I know that which field was not validated which caused Update cancel.

    Here is my code

    SalesOrderServiceClient proxy = new SalesOrderServiceClient();
    
    //AxdEntityKey_LogisticsPostalAddress addressKey;
    
    CallContext _callContext = new CallContext();
    _callContext.Company = "ART";
    
    AxdSalesOrder salesOrder = new AxdSalesOrder();
    
    AxdEntity_SalesTable salesTable = new AxdEntity_SalesTable();
    salesTable.CurrencyCode = "USD";
    salesTable.CustAccount = "11224";
    salesTable.DeliveryDate = Convert.ToDateTime("10/12/2017");
    salesTable.ReceiptDateRequested = Convert.ToDateTime("10/14/2017");
    salesTable.Payment = "N30";
    salesTable.InventLocationId = "10";
    salesTable.InventSiteId= "1";
    
    salesTable.PurchOrderFormNum = "A875891";
    
    
    AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine();
    salesLine.ItemId = "PF201292";
    salesLine.SalesQty = 1;
    salesLine.SalesUnit = "EA";
    salesLine.InventDimId = "ART00000001";
    
    AxdEntity_InventDim inventDim = new AxdEntity_InventDim();
    inventDim.InventSiteId = "1";
    inventDim.InventLocationId = "10";
    inventDim.InventDimId = "ART00000001";
    
    salesLine.InventDim = new AxdEntity_InventDim[1] { inventDim };
    salesTable.SalesLine = new AxdEntity_SalesLine[1] { salesLine };
    salesOrder.SalesTable = new AxdEntity_SalesTable[1] { salesTable };
    
    EntityKey[] returnedSalesOrderEntityKey = proxy.create(_callContext, salesOrder);
    
    EntityKey returnedSalesOrder = (EntityKey)returnedSalesOrderEntityKey.GetValue(0);
    lblOutput.Text = "The sales order created has a Sales ID of " + returnedSalesOrder.KeyData[0].Value;


  • Community Member Profile Picture
    on at

    Exceptions I am getting ar

    1. Error found when validating record.
    2. Update has been canceled.

     

    Screenshot

     

    5241.error.jpg

  • Community Member Profile Picture
    on at

    Before providing Invent Dim I was getting Inventory dimension identification not specified exception.

    Screenshot

    2021.error.jpg

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at
  • source258147 Profile Picture
    1,025 on at

    Could you please explain from where you got this class

    AxdSalesOrder salesOrder = new AxdSalesOrder();
    



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