Does anyone have any suggestions how to setup opening page that depend on some bool value in setup table, if some bool value is mark open one page and if is not open default page?
You cannod code that directly on the menu, but instead you can point the menu item to a codeunit, and then inside theRUN trigger in the codeunit you can add your code selecting one page or another.
You cannod code that directly on the menu, but instead you can point the menu item to a codeunit, and then inside theRUN trigger in the codeunit you can add your code selecting one page or another.
You cannot code that directly on the menu, but instead you can point the menu item to a codeunit, and then inside theRUN trigger in the codeunit you can add your code selecting one page or another.
Agree with both the solution from @Slawek_Guzek and @behar but something to be noted,
Normally I don't prefer writing code on OnOpenPage Trigger from performance perspective and too this code of the page will unnecessary get executed if this Page is not supposed to be open depending on Bool
Writing your code on codeunit makes a sense and its a a good approach but dont make a new Codeunit just for this, anyhow you need to manipulate this,
Answers
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
What if I want to control page opening from menu suite?
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Can please explain this via an example code?
Thanks in advance.
OnOpenPage()
BoolValue:=TRUE;
IF BoolValue = TRUE THEN
BEGIN
PAGE.RUNMODAL(30) ;
CurrPage.CLOSE;
END;
Normally I don't prefer writing code on OnOpenPage Trigger from performance perspective and too this code of the page will unnecessary get executed if this Page is not supposed to be open depending on Bool
Writing your code on codeunit makes a sense and its a a good approach but dont make a new Codeunit just for this, anyhow you need to manipulate this,
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/