December 2018
Beginner
210 pages
5h 7m
English
So far, we have dealt with finding required records from a database table. Now let's implement the last part of the exercise and update the retrieved records:
LOCAL PROCEDURE SetSalesLineDiscountForItem(ItemNo : Code[20];UnitPrice : Decimal;StartingDate : Date;EndingDate : Date);VAR SalesPrice : Record "Sales Price"; RecordFound : Boolean;BEGIN SalesPrice.VALIDATE("Item No.",ItemNo); SalesPrice.VALIDATE("Sales Type",SalesPrice."Sales Type"::"All Customers"); SalesPrice.VALIDATE("Starting Date",StartingDate); RecordFound := SalesPrice.FIND; SalesPrice.VALIDATE("Unit Price",UnitPrice); SalesPrice.VALIDATE("Ending Date",EndingDate); IF RecordFound THEN SalesPrice.MODIFY(TRUE) ELSE SalesPrice.INSERT(TRUE);END; ...Read now
Unlock full access