Hi Friends,
I have facing this error when i am trying to create sales order in AIF Service Ax 2012 using Visual studio.
My Code
// Instantiate an instance of the service client class.
EmployeeInfo4ServiceClient proxy = new EmployeeInfo4ServiceClient();
// Create an instance of the document class.
AxdEntity_SalesTable_1 salesTable = new AxdEntity_SalesTable_1();
AxdEmployeeInfo4 salesOrder = new AxdEmployeeInfo4();
// Create instances of the entities that are used in the service and
salesOrder.SalesTable_1 = new SalesOrderReferrence1.AxdEntity_SalesTable_1[1] { salesTable };
salesTable.CurrencyCode = "USD";
salesTable.CustAccount = "INMF-000001";
salesTable.InvoiceAccount = "INMF-000001";
salesTable.SalesId = "INMF-000071";
salesTable.DeliveryDate = DateTime.Now.Date;//Convert.ToDateTime("4/21/2015");
salesTable.Payment = "PP";
salesTable.SalesName = "Wingtip Toys India Ltd.";
salesTable.ShippingDateRequested = salesTable.DeliveryDate;
AxdEntityKey_LogisticsPostalAddress LPA = new AxdEntityKey_LogisticsPostalAddress();
LPA.Location_LocationId = "5637282089";
salesTable.SalesType = AxdEnum_SalesType.Journal;
salesTable.ShippingDateRequested = DateTime.Now.Date;
AxdExtType_EffectiveDateTime date = new AxdExtType_EffectiveDateTime();
date.timezone = AxdEnum_Timezone.GMT_COORDINATEDUNIVERSALTIME;
DateTime dateValue = new DateTime(2015, 4, 29, 14, 10, 53, 001, DateTimeKind.Utc);
date.timezoneSpecified = false;
date.localDateTimeSpecified = false;
date.Value = dateValue;
LPA.ValidFrom = date;
salesTable.DeliveryPostalAddress = LPA;
AxdEntity_SalesLine salesLine = new AxdEntity_SalesLine();
salesLine.ItemId = "1105";
salesLine.SalesQty = 9;
salesLine.SalesUnit = "ea";
salesLine.InventDimId ="000458";
CallContext callContext = new CallContext();
callContext.Language = "en-us";
callContext.Company = "INMF";
salesTable.SalesLine = new AxdEntity_SalesLine[1] { salesLine };
salesOrder.SalesTable_1 = new AxdEntity_SalesTable_1[1] { salesTable };
try
{
// Call the create method on the service passing in the document.
EntityKey[] returnedSalesOrderEntityKey = proxy.create(callContext, salesOrder);
// The create method returns an EntityKey which contains the ID of the sales order.
EntityKey returnedSalesOrder = (EntityKey)returnedSalesOrderEntityKey.GetValue(0);
Console.WriteLine("The sales order created has a Sales ID of " +
returnedSalesOrder.KeyData[0].Value);
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
Console.ReadLine();
}
Please give any solution to solve this error.
Thanks&Regards,
Ashwini.E