pageextension 50144 MyExtension extends "Sales Order Subform" { layout { modify("Unit Price") { trigger OnAfterValidate() var rec_Item: Record Item; rec_SalesSetup: Record "Sales & Receivables Setup"; rec_Set: Record "Sales & Receivables Setup"; recSO: Record "Sales Line"; begin rec_SalesSetup.Get(); rec_Item.Get(Rec."No."); IF (Rec."Unit Price" < rec_Item."Unit Cost") AND (rec_SalesSetup."Allow Negative Unit Price" = true) then begin Clear(myPage); IF myPage.RunModal() = Action::Cancel then begin rec_Item.Reset(); rec_Item.Get(Rec."No."); recSO.SetFilter("Document No.", Rec."Document No."); recso.SetRange("Line No.", Rec."Line No."); recSO.SetFilter("No.", Rec."No."); IF recSO.FindFirst() then begin Rec."Unit Price" := rec_Item."Unit Cost"; CurrPage.Update(); end; end else IF myPage.RunModal() = Action::Ok then begin rec_Item.Reset(); IF Password = rec_Set.Password then CurrPage.Close() end; END; end; } var myPage: Page Password; }
page 50140 Password { PageType = StandardDialog; ApplicationArea = All; UsageCategory = Administration; // SourceTable = ; layout { area(Content) { field(Password; Password) { ApplicationArea = All; } } } var Password: Text[10]; }
IF myPage.RunModal() = Action::Ok then begin rec_Item.Reset(); IF Password = rec_Set.Password then CurrPage.Close() end;code works. Right now it doesn't recognize Password