Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

CurrPage.EDITABLE(FALSE);

(0) ShareShare
ReportReport
Posted on by 2,983

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

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: CurrPage.EDITABLE(FALSE);

    Try to use one boolean variable to make page editable and non editable.

  • Suggested answer
    RE: CurrPage.EDITABLE(FALSE);

    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.

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    Tharanga Chandrasekara 23,116 on at
    RE: CurrPage.EDITABLE(FALSE);

    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.

  • Verified answer
    Rajasekhar@MS Profile Picture
    Rajasekhar@MS 5,567 on at
    RE: CurrPage.EDITABLE(FALSE);

    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.

  • Suggested answer
    IshwarSharma Profile Picture
    IshwarSharma 729 on at
    RE: CurrPage.EDITABLE(FALSE);

    Did you try to debug? Is (MyCodeUnit.Post(Rec)) returning True and going to the next line of code?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CurrPage.EDITABLE(FALSE);

    Did you check the Editable property of the Page ? By default it would be TRUE always.

    msdn.microsoft.com/.../dd301158(v=nav.90).aspx

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans