web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

How could I change the shown system defined button?

(0) ShareShare
ReportReport
Posted on by

>> Question:

How could I change the default system defined button of a form from "Save"(SystemDefinedSaveButton) to "Edit"(SystemDefinedViewEditButton) in code, to control the view/edit mode?

>> Background:

Basically, when we enter a new form, such as ledger journal, the system defined button shown on the left upper is "Edit" which we can click and change the form mode from view to edit mode, then the caption witl change from "Edit" to "Save".

But in some forms, the system defined button is "Save", thus we cannot manually change the form mode from view to edit mode.

pastedimage1676294638033v1.png    pastedimage1676294660972v2.png

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi Kai cheng,

    This property is setup on the menu item - There will be property named Open mode on the menu item properties - You need to change that to desired property you want.

    If you want to change save mode to edit mode - On the form >> Options tab >> Select Edit group >> Read mode - This will change the form from Save to Edit mode again.

    There is a another option which is specific to user - Navigate to gear icon on the top right corner - Select the gear icon >> Select User options >> Under preference tab - Set the Default view edit mode to desired values and check.

    Thanks,

    Girish S.

  • Kai Cheng Profile Picture
    on at

    Thanks a lot, Girish. You provided two useful ways to do from UI. But what I need is to revise it from code. Sorry that I didn't describe it clearly.

    I want to change the system defined button in code for a from, from "Save"(SystemDefinedSaveButton) to "Edit"(SystemDefinedViewEditButton).

    Take "Counting" journal for an example.

    Here is the FNO link: usnconeboxax1aos.cloud.onebox.dynamics.com/

    When you enter the Counting form, the button on the left upper is "Edit", here you cannot edit the records in the form as it is in view mode.

    After you click the 'Edit' button, the form changes to edit mode, and the "Edit" button will change to "Save" as well.

  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    You can extend the display menu item - But you cannot set the open mode property as the property was non editable.

    Only option will be setting it via code on form OnInitialized form event handler.

    Check whether the below code works for your scenario.

    [FormEventHandler(formStr(FormName), FormEventType::Initialized)]
    public static void formName_OnInitialized(XFormRun sender, FormEventArgs e)
    {
        FormRun fRun = sender as FormRun;
        fRun.setEditMode(false);
    }

    Thanks,

    Girish S.

  • Kai Cheng Profile Picture
    on at

    Thank you so much, Girish.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 303 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 144 Super User 2025 Season 2

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 91 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans