简体   繁体   中英

SalesOrder - MS Dynamics AX 2012 - AIF - Fields description

Here is the simple most code to create a SalesOrder in MS Dynamics AX 2012 but its not working for me. Currently I am debugging the code. The purpose of this post is that please someone tell me the details/description of highlighted (Bold or enclosed in **) fields in code. From details I mean

  1. Are these fields related. If yes then how.
  2. Are these user defined fields (inputs) or are these coming from some other table.
  3. If these fields are coming from some other table then what table is that.
  4. How should I verify these fields in other tables.

      SalesOrderServiceClient _Client; using (_Client = new SalesOrderServiceClient()) { CallContext _callContext = new CallContext(); _callContext.Company = "ART"; AxdSalesOrder salesOrder = new AxdSalesOrder(); AxdEntity_SalesTable salesTable = new AxdEntity_SalesTable(); salesTable.CurrencyCode = "USD"; **salesTable.CustAccount = "00036";** salesTable.DeliveryDate = Convert.ToDateTime("11/13/2017"); salesTable.ReceiptDateRequested = Convert.ToDateTime("11/14/2017"); salesTable.Payment = "N30"; **salesTable.PurchOrderFormNum = "1AB7567";** AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine(); **salesLine.ItemId = "PF507028";** salesLine.SalesQty = 1; salesLine.SalesUnit = "ea"; AxdEntity_InventDim inventDim = new AxdEntity_InventDim(); inventDim.InventSiteId = "1"; inventDim.InventLocationId = "13"; **inventDim.ConfigId = "153081-DF-00046";** **inventDim.InventDimId = "ART00720252";** salesLine.InventDim = new AxdEntity_InventDim[1] { inventDim }; salesTable.SalesLine = new AxdEntity_SalesLine[1] { salesLine }; salesOrder.SalesTable = new AxdEntity_SalesTable[1] { salesTable }; _Client.create(_callContext, salesOrder); lblOutput.Text += "<br />Success"; } 

The error I am getting is very generic ie Error found when validating record. Update has been cancelled. . From error its obvious that its some sort of validation error that is why I have made this post.

Thank you,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM