Error insert Item with "Item Disc. Group" from Web Service

LnZLnZ Member Posts: 37
edited 2010-06-15 in NAV Three Tier
Hi all,
I have written a simple web services insert item lines in an existing order, but when I try to insert an item with "Item Disc. Group" it gives me a strange error sayng "field saleslinelinediscexists is readonly"
If I comment the following code in c.u. 7000 everything works
        IF ItemDiscGrCode <> '' THEN BEGIN
          SETRANGE(Type,Type::"Item Disc. Group");
          SETRANGE(Code,ItemDiscGrCode);
          CopySalesDiscToSalesDisc(FromSalesLineDisc,ToSalesLineDisc);//Blocca il Web Service
        END;
Here is my .net code
OrderService = new Order_Service();
OrderService.UseDefaultCredentials = true;
Order SalesOrder = OrderService.Read(OrderNo);
SalesOrder.SalesLines = SalesOrder.SalesLines.Concat(new[] { new Sales_Order_Line() }).ToArray();
OrderService.Update(ref SalesOrder);
count = SalesOrder.SalesLines.Length;
Sales_Order_Line line1 = SalesOrder.SalesLines[count-1];
line1.Type = OrderReference.Type.Item;
line1.No = ItemNo;
line1.Quantity = Quantity;
line1.QuantitySpecified = true;
line1.Unit_Price = Price;
line1.Unit_PriceSpecified = true;
OrderService.Update(ref SalesOrder); 
Any idea? If the item has no discount group everything goes well
Thank You
LnZ

Answers

  • LnZLnZ Member Posts: 37
    Any Idea?it seems a problem with standard navision code, possible?
  • LnZLnZ Member Posts: 37
    Still need help :cry:
  • LnZLnZ Member Posts: 37
    Solved, you have to delete "FieldSalesLineDiscExist","FieldSalesPriceExist" from page 46
Sign In or Register to comment.