Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Alert function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
function showConfirmDialog() {
    Xrm.Utility.confirmDialog("Click Yes or No to set the Personal Notes Value",
        function() {
            Xrm.Page.getAttribute("description").setValue("Yes Callback fired");
        },
        function() {
            Xrm.Page.getAttribute("description").setValue("No Callback fired");
        });
}

this is my code, i want users to fill the description manually after clicking on "ok" or "cancel"
i dont want the setValues() to be in description.
  • Suggested answer
    RE: Alert function

    Hello, It looks like your code is working correctly. So if you want to use a different field than description, you just have to change your code to use a different field.

    For example I took your code and made it run for the fax field on the Accounts form.

    We need the logical name of the field.

    pastedimage1580375103292v1.png

    And then we just change the code slightly.

    function showConfirmDialog() {
    Xrm.Utility.confirmDialog("Click Yes or No to set the Personal Notes Value",
    function() {
    Xrm.Page.getAttribute("fax").setValue("Yes Callback fired");
    },
    function() {
    Xrm.Page.getAttribute("fax").setValue("No Callback fired");
    });
    }

    pastedimage1580375177549v2.png

    Hope this helps.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans