Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

(0) ShareShare
ReportReport
Posted on by 1,530

Hi

Working with the UCI. I am trying to use the formContext.data.save() or the formContext.data.save().then().

The problem that I am having is that I am getting the following dialog box. 

I would also like to use my own Xrm.Utility.showProgressIndicator when saving a record.  But the save button is already displaying a ProcessIndicator when using a normal save.

Is there a way to get around the dialog box when using formContext.data.save() or formContext.data.save().then().

ProcessBar.JPG

And can I use my own Xrm.Utility.showProgressIndicator when saving without using the normal save Xrm.Utility.showProgressIndicator.

I trying to not have to use this code when saving.

setTimeout(() => {
 callFunction(formContext);
}, 3000);

  • Clint Woods Profile Picture
    Clint Woods 1,031 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    That fix didn't work for me. Did I miss something?

    pastedimage1592436065026v3.png

  • msreddy543 Profile Picture
    msreddy543 10 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    I am using this on my save

    export function saveform(context)

    {
    try {


    formContext.data.entity.save("saveandclose");

    formContext.data.entity.addOnSave(function () {

    });
    }

  • Ics_rthompsoneu Profile Picture
    Ics_rthompsoneu 72 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    Hi,

    What is actually happening.  Are you getting the Dialog box?  Data not writing.

    Can you show your code.

  • msreddy543 Profile Picture
    msreddy543 10 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    Hey Thompson,

    I am trying to do the save on one of my forms.

    I tried formContext.data.entity.addOnSave(function () {

         }); inside the save method, But I am still seeing the issue. Could you please help me with this?

    Help will be appreciated.

  • Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    Thanks for sharing!

  • Verified answer
    rthompson Profile Picture
    rthompson 1,530 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    Support helped me resolve this issue by doing the following on a save event.

    Issue: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    ​Resolution: Issue is fixed by below code,

    function OnSaveEvent(executionContext, iOption) {
          var formContext = executionContext.getFormContext(); // get formContext
          formContext.getAttribute("new_instrumentid").setSubmitMode("always");
          var instrumentId = "Car Instrument";
          formContext.getAttribute("new_instrumentid").setValue(instrumentId);
    
          //Need to use the following code.  This will suppress the dialog box
          formContext.data.entity.addOnSave(function () {
    
          });
    }

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    Hi Henry,

    Thanks I put in a support ticket.

    I have tried putting the showProgressIndicator before but the dialog box is showing each time.

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Dialog box message displaying when using formContext.data.save().then() or formContext.data.save()

    Hello,

    In my tests I haven't encountered a similar dialog box as the one you show here when using the save client API.
    Can I advise that you open a support request? https://admin.powerplatform.microsoft.com/support

    Also, what do you mean using your own Xrm.Utility.showProgressIndicator? 
    showProgressIndicator and closeProgressIndicator are both first-party client APIs.

    If you know the save action is going to take a while, have you tried triggering showProgressIndicator before triggering a save, and use closeProgressIndicator as the successCallback of your save?

    Henry

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,602 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,340 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans