Wednesday, November 27, 2019

NAV CAL - Change Color


  • Create Global StyleText Text
  • Create Function UpdateStyle, Return Text
  • Update StyleText OnAfterGetRecord
OnAfterGetRecord()
StyleText := UpdateStyle;

UpdateStyle() : Text

IF "Matched Status" = 'Exact Match' THEN BEGIN
EXIT('Favorable');
END ELSE BEGIN
EXIT('Unfavorable');
END;

  • On Page Field Property StyleExpr
    • enter global StyleText



Modify(InventoryField)
        {
            StyleExpr = StyleText;
        }

    trigger OnAfterGetRecord()
    begin
        StyleText := UpdateStyle;
    end;

    procedure UpdateStyle()Text
    begin
        IF Inventory <= "Reorder Point" THEN
            EXIT('UnFavorable');
    End;

    var
        StyleText: Text[20];

No comments:

Post a Comment