Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Turning fields invisible or not editable on 2013

Posted on by 1,645

Is there a way to turn invisible or not editable fields on page when certain criteria happens?

on old version the code was:

Currform.MyField.VISIBLE := FALSE;
Currform.MyField.EDITABLE := FALSE;

Since I upgrade to 2013 the code change I'm in learning process again ;)

Thank you in advance.

*This post is locked for comments

  • spyroot Profile Picture
    spyroot 1,645 on at
    RE: Turning fields invisible or not editable on 2013

    That works Suresh !!! at least this way the data is hidden and there's no way to edit as well.

    Thank you so much for your time and support.

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Turning fields invisible or not editable on 2013

    Create another variable and but use reverse logic of the current variable and assign that to Editable property,so that you cannot click when hidvalue is true, since the editable will be false.

    Give a try.

  • spyroot Profile Picture
    spyroot 1,645 on at
    RE: Turning fields invisible or not editable on 2013

    I used the HideValue property but data turns visible when you place the cursor on that particular field. :(

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Turning fields invisible or not editable on 2013

    One other way i thought was do your logic opposite and apply that expression to the HideValue property this way it will hide the value but control will still visible on the page not sure if you like it or not.

  • spyroot Profile Picture
    spyroot 1,645 on at
    RE: Turning fields invisible or not editable on 2013

    Let me know if you find another way.

    Thanks again.

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Turning fields invisible or not editable on 2013

    You are correct, i tried it and the visibility does not work, i think controls don't refresh or update when you use next or previous actions.  

  • spyroot Profile Picture
    spyroot 1,645 on at
    RE: Turning fields invisible or not editable on 2013

    I just cloned the code from Customer card as you suggested before and works only on Editable properties but not for visible properties. (field turns editable and not editable according the rule implemented).

    Even I renamed both properties (Visible and Editable) to TurnVisible and only the Editable property works changing the field to editable/not editable dynamically but the visible property stays unchanged.

    Thank you Suresh for all your time and support.

  • mmv Profile Picture
    mmv 11,465 on at
    RE: Turning fields invisible or not editable on 2013

    hi,

    Have you forgotten to place this variable in the Visible property of the control by any chance?

    Best Regards,

    MMV

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Turning fields invisible or not editable on 2013

    Activate the debugger. Please set the breakpoint in onaftergetrecord and onaftergetcurrRecord and check if the code executes when used next record and previous record actions.

  • spyroot Profile Picture
    spyroot 1,645 on at
    RE: Turning fields invisible or not editable on 2013

    I'm sorry does not work :(

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans