layout { addafter("Line Discount %") { field("Premium %"; "Premium %") { ApplicationArea = All; BlankZero = true; trigger OnValidate() begin Update_Premium_Amount(); end; } field("Premium Amount"; "Premium Amount") { ApplicationArea = All; BlankZero = true; trigger OnValidate() begin Update_Premium_Percentage(); end; } } } local procedure Update_Premium_Amount() var percValue: Decimal; begin Clear(percValue); percValue := rec."Premium %" / 100; rec."Premium Amount" := rec."Line Amount" * percValue; rec."Line Amount" := rec."Line Amount" + rec."Premium Amount"; CurrPage.Update(); UpdateAmounts(); CalcLineAmount(); end; local procedure Update_Premium_Percentage() begin if rec."Line Amount" <> 0 then begin rec."Premium %" := (rec."Premium Amount" * 100) / rec."Line Amount"; rec."Line Amount" := rec."Line Amount" + rec."Premium Amount"; end; CurrPage.Update(); UpdateAmounts(); CalcLineAmount(); end;
Answers
RIS Plus, LLC