Test it from Visual Studio, even i remove that line error exist.
Error i can see from Services and Application Integration Framework->Exceptions.
error is different now :
"The tag CurrencyCode is not allowed; it must be removed or marked null."
this is the full code.
public static void CreateSalesOrder1()
{
SalesOrderServiceClient SClient = new SalesOrderServiceClient();
AxdSalesOrder salesOrder1 = new AxdSalesOrder();
EntityKey key = new EntityKey();
KeyField fld = new KeyField();
AxdEntity_SalesTable salesTable = new AxdEntity_SalesTable();
salesTable.CurrencyCode = "USD";
salesTable.CustAccount = "C-000003";
salesTable.DeliveryDate = new DateTime(2017, 5, 19);
salesTable.Payment = "N07";
salesTable.PurchOrderFormNum = "PO";
AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine();
salesLine.ItemId = "A3300-HV";
salesLine.SalesQty = 1;
salesLine.SalesUnit = "ea";
salesLine.SalesPrice = 2000;
AxdEntity_InventDim inventDim = new AxdEntity_InventDim();
inventDim.ConfigId = "HD";
inventDim.InventColorId = "01";
// inventDim.InventSizeId = "42";
salesLine.InventDim = new AxdEntity_InventDim[1] { inventDim };
salesTable.SalesLine = new AxdEntity_SalesLine[1] { salesLine };
salesOrder1.SalesTable = new AxdEntity_SalesTable[1] { salesTable };
//CallContext callContext = new CallContext();
var callContext = new CallContext()
{
Company = "test",
// Language = "en-uk",
};
//callContext.Language = "en-us";
//callContext.Company = "test";
SClient.ClientCredentials.Windows.ClientCredential.Domain = "abc.com";
SClient.ClientCredentials.Windows.ClientCredential.UserName = "abc";
SClient.ClientCredentials.Windows.ClientCredential.Password = "Abc@2017";
try
{
EntityKey[] returnedSalesOrderEntityKey = SClient.create(callContext, salesOrder1);
EntityKey returnedSalesOrder = (EntityKey)returnedSalesOrderEntityKey.GetValue(0);
Console.WriteLine("The Sales ID is " + returnedSalesOrder.KeyData[0].Value);
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
Console.ReadLine();
}
}