Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

way to change a page in view mode to create mode using C/Side code

(0) ShareShare
ReportReport
Posted on by

Hi,

Any way to change a page in View mode (RunFormMode = View) to Create mode(RunForm Mode =Create ) based on the status of a checkbox in that page using C/AL code.

Two conditions are follows:

When Checkbox = True, RunFormMode of the page should be in Create mode.

when  Checkbox = False, RunFormMode of the page should be in View  mode.

How to change the the RunFormMode of  a page using  C/AL Code in Navision RTC?

Plz help! !

Plz

*This post is locked for comments

  • Suggested answer
    Suresh Kulla Profile Picture
    47,688 on at
    RE: way to change a page in view mode to create mode using C/Side code

    You can make a field editable and non-editable on the fly based on other field value but once the page is loaded i don't think you can make the page editable or non-editable you  can do that before the page is open.

    If you are looking to make the control editable, then check the customer card page for example the contact field on that page is controlled based on the primary contact no. value.

  • keoma Profile Picture
    32,727 on at
    RE: way to change a page in view mode to create mode using C/Side code

    please try the second solution. button ...

  • Community Member Profile Picture
    on at
    RE: way to change a page in view mode to create mode using C/Side code

    I applied your logic but the field in the page (RTC) didn't change to edit mode after enabling the checkbox.

    Plz help...

  • Verified answer
    keoma Profile Picture
    32,727 on at
    RE: way to change a page in view mode to create mode using C/Side code

    if you push a checkbox to set the form in to viewmode it won't be able to set it back to edit mode, because the form is in view mode.

    but you can do the following: define a global variable ControlEditable (type boolean) and set this variable as value to the editable property of the controls, which you want to switch the edit/view mode. then add a checkbox control to the form and use the triggers onpush and onvalidate to switch by setting the variable ControlEditable to true/false followed by a currform.update.

    other solution:
    add a button to the form,
    add following code to trigger button-onpush:
    currform.editable := not currform.editable;
    currform.update;

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans