以下是在MS Dynamics AX 2012中创建SalesOrder的简单大多数代码,但它不适用于我。目前我正在调试代码。这篇文章的目的是请有人告诉我代码中突出显示(粗体或封装在**)字段的详细信息/描述。我的意思是
我应该如何验证其他表格中的这些字段。
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";
}
我得到的错误非常通用,即验证记录时发现错误。更新已取消。。从错误中可以明显看出它的某种验证错误就是我发布这篇文章的原因。
谢谢,