Error: Unit_of_Measure_Code is readonly yet i want to specify the Unit_of_Measure_Code on sales lines. Nav picks a default one.
*This post is locked for comments
Error: Unit_of_Measure_Code is readonly yet i want to specify the Unit_of_Measure_Code on sales lines. Nav picks a default one.
*This post is locked for comments
According to T37.CanEditUnitOfMeasureCode() - you can edit UoM code if there more than 1 unit of measure for item. If there is 1 uom for item, tan it is not editable.
Also check that you change "Unit of Measure Code". Because "Unit of Measure" - is description of unit of measure code
Here is the C# code.
Also another error is Unit_of_Measure_Code is read only
var hh = or.SalesLines[h];
hh.Quantity = decimal.Parse(ce2.quantity.ToString());
hh.Unit_Price = decimal.Parse(ce2.unit_price.ToString());
hh.Unit_PriceSpecified = true;
hh.Type = oNavSalesOrder.Type.Item;
hh.No = ce2.item_no;
hh.Total_Amount_Incl_VATSpecified = true;
hh.Total_Amount_Incl_VAT = decimal.Parse(ce2.line_total.ToString());
hh.Total_Amount_Excl_VATSpecified = true;
hh.Total_Amount_Excl_VAT = decimal.Parse(ce2.line_total.ToString());
hh.TotalSalesLine_Line_AmountSpecified = true;
hh.Total_VAT_AmountSpecified = true;
hh.Total_VAT_Amount = decimal.Parse(ce2.line_total.ToString());
hh.Unit_of_Measure = "Piece";
hh.Location_Code = "FG-001";
hh.Unit_of_Measure_Code = ce2.uom_id.ToString();
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156