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 :
Finance | Project Operations, Human Resources, ...
Answered

Conformation Dialog on Form Save button

(0) ShareShare
ReportReport
Posted on by

Hello  Experts,

i want to display one confirmation dialog on click of SAVE(System Defined button), so when user will click on save button , one conformation dialog box will open with a message and YES and NO. If yes Save button will save data if no dialog box will disappear and no action will perform.

I found one similar thread but not useful (Link)

Please advise on this.

 

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi Sachin,

    You don't have to necessarily use the Save button to write data to the database. In the most forms, you can just move to another record or close the form. It would be then better to use a generic place which will be triggered by all different user actions.

    If your question is related to a single form, you can write coding for this on the validateWrite() method. There is also an event on the datasource available: OnValidatingWrite().

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Sachin,

    You can try using a message box. You can put the logic in the validateWrite method of the form as Andre suggested.

    if (ret && (box::yesNo("Are you sure you want to save this record?', dialogButton::Yes, 'Confirmation') == dialogButton::Yes))
    {
        ret = true;
    }
    else
    {
        ret = false;
    }

  • Community Member Profile Picture
    on at

    Hello ,

    Thanks for the help , i am overriding validateWrite()  method on Data source level and using the code you mentioned and it works fine the way i want.

    Thanks again , have a great day

  • Community Member Profile Picture
    on at

    Thanks Andre, my question is related to a single custom form.  and requirement done using  validateWrite  method like you suggested.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans