Access page field's value through Runmodal (or Run?)

mysamza
Member Posts: 66
I am trying to ask a user for a password if it tries to enter unit price below a threshold.
I do this through a StandardDialog page and trying to write the logic to tackle the Cancel and Ok Button.
Here is the StandardDialog page which has 1) page field that is just a variable. We don't need to store this value hence it is to just check for the password against the Password field I created extending the Sales & Receivable Setup page and table.
The problem is in the
IF myPage.RunModal() = Action::Ok then begin
I can't access the Password page field. How do I access this field's value so my
I do this through a StandardDialog page and trying to write the logic to tackle the Cancel and Ok Button.
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; }
Here is the StandardDialog page which has 1) page field that is just a variable. We don't need to store this value hence it is to just check for the password against the Password field I created extending the Sales & Receivable Setup page and table.
page 50140 Password { PageType = StandardDialog; ApplicationArea = All; UsageCategory = Administration; // SourceTable = ; layout { area(Content) { field(Password; Password) { ApplicationArea = All; } } } var Password: Text[10]; }
The problem is in the
IF myPage.RunModal() = Action::Ok then begin
I can't access the Password page field. How do I access this field's value so my
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
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions