web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • Verified answer
    keoma Profile Picture
    32,729 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;

  • 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...

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

    please try the second solution. button ...

  • Suggested answer
    Suresh Kulla Profile Picture
    50,237 Super User 2025 Season 2 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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Alexander Ermakov Profile Picture

Alexander Ermakov 2

#2
SC666 Profile Picture

SC666 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans