I have created one new field 'VAT Amount' in purchase line table. and i want this to update as calculated field as:
VAT Amount= Amount including VAT - Amount; eg. VAT Amount=15-10=5;[field: 'Amount including VAT' and 'Amount' already is present]
SO, i tried the below code in VAT Amount field ONValidate trigger in Purchase line table, but its not updating the field.
VAT Amount - OnValidate()
VatAmount := PurchLine2."Amount Including VAT" -PurchLine2.Amount;
UNTIL PurchLine2.NEXT= 0;
Will you please guide me,what i am doing wrong.