I am new the NAV. While I am trying to create SalesOrderLine NAV using SOAP Webservice. I am getting "The value "150717D" can't be evaluated into type Date." error. I have posted my sample code below. Please let me know how to fix this error.
Sample Code
//Creating Sales Order in NAV
SalesOrder order = new SalesOrder();
order.Sell_to_Customer_Name = "New highland School";
order.Requested_Delivery_Date = DateTime.Now;
order.VAT_Bus_Posting_Group = "STD";
SOService.Create(ref order);
///Creating SalesOrderLine in NAV
SalesOrderLine sol = new SalesOrderLine();
sol.Type = SalesOrderLineRef.Type.Item;
sol.Document_No = order.No;
sol.Sell_to_Customer_No = "NEWHIGH001002";/// Customer Code
sol.No = "PRDSCHOOLONLY"; /// Product Code
sol.Quantity = 2;
sol.VAT_Prod_Posting_Group = "UK";
sol.Total_VAT_AmountSpecified = false;
sol.Total_Amount_Incl_VATSpecified = false;
sol.TotalSalesLine_Line_AmountSpecified = false;
sol.Total_Amount_Excl_VATSpecified = false;
sos.Create(ref sol);
0
Answers
Also do a insert after setting PK, and then update the rest.
.
Hello Juhl,
I just passing only following data while creating SalesOrderLine. If possible can you please share any sample code to create record.
///Creating SalesOrderLine in NAV
SalesOrderLine sol = new SalesOrderLine();
sol.Type = SalesOrderLineRef.Type.Item;
sol.Document_No = order.No;
sol.Sell_to_Customer_No = "NEWHIGH001002";/// Customer Code
sol.No = "PRDSCHOOLONLY"; /// Product Code
sol.Quantity = 2;
sol.VAT_Prod_Posting_Group = "UK";
sol.Total_VAT_AmountSpecified = false;
sol.Total_Amount_Incl_VATSpecified = false;
sol.TotalSalesLine_Line_AmountSpecified = false;
sol.Total_Amount_Excl_VATSpecified = false;
sos.Create(ref sol);