I have this code in an Action button of a New page I've created.
The idea is that if I call my "post" function, and it returns "TRUE", the page should not be editable at all
Register Receipt - OnAction() IF (MyCodeUnit.Post(Rec)) THEN CurrPage.EDITABLE(FALSE);
However, this is not working. The page is still editable, even after "CurrPage.EDITABLE(FALSE);"
Any ideas on why it's not working or how to achieve this behaviour??
*This post is locked for comments
Try to use one boolean variable to make page editable and non editable.
Hi,
Agreed with Raj and Tharanga.
Also, since you are using NAV 2016, you can try redesigning your func (MyCodeUnit.Post(Rec)) inside a TryFunction. Actually the inverse of TryFunction.
Hope it helps.
It does not work like that. You will have to use the field property of the Editable and assign a Boolean variable to it. True that you need to go to each field and assign the variable, it will be a pain, but that is the only option I can see. Hope someone will prove me wrong.
Hi
You can not use CurrPage,Editable(FALSE) on Actions, instead of CurrPage.Editable, you can set all the fields of the Page Editable or non editable by defining one Boolean variable and place it on the Editable property of all fields or controls.
Did you try to debug? Is (MyCodeUnit.Post(Rec)) returning True and going to the next line of code?
Did you check the Editable property of the Page ? By default it would be TRUE always.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156