There have a boolean field( Order Status ) in the Header Tab(General), when the Field is in true condition then if you select the item no. then the unit price must show 0 and Quantity:=15,
I write the following code in OnValidate of No. in Sales Line Table …
SalesHeader3.RESET;
SalesHeader3.SETRANGE(SalesHeader3.“No.”,“Document No.”);
IF SalesHeader3.FINDFIRST THEN BEGIN
MESSAGE('Status %1 ',SalesHeader3.“Order Status”);
IF SalesHeader3.“Order Status”=TRUE THEN //BEGIN
“Line No.”+=10000;
“Unit Price”:=0;
Quantity:=15;
MESSAGE('U.Price %1 ',“Unit Price”);
END;
---------> Here the Quantity is update instantly but the unit price show as base price not assigned as 0.
what should i do?