Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Form is not reloaded after Dialog execution

Posted on by 350

Hi, I have a Custom "Cancel Case"button which executes a Dialog in order to get a detailed reason for Cancelling the case from the Agent performing that action (our customers wants to get such a detailed information and not relying in the built-in Cancel reasons in the CRM). After getting the text of reason, the Dialog sets the state of the Case record on Cancelled. The code, which I borrowed from the Internet, is as follows:

runDialogAndRefresh = function(objectTypeCode, dialogId) {
    var primaryEntityId = Xrm.Page.data.entity.getId();
    var rundialog = Mscrm.CrmUri.create('/cs/dialog/rundialog.aspx');
    rundialog.get_query()['DialogId'] = dialogId;
    rundialog.get_query()['ObjectId'] = primaryEntityId;
    rundialog.get_query()['EntityName'] = objectTypeCode;
    var hostWindow = window;
        if (typeof(openStdWin) == 'undefined') {
            hostWindow = window.parent; // Support for Turbo-forms in CRM2015 Update 1
        }
        if (typeof(hostWindow.openStdWin) != 'undefined') {
            hostWindow.openStdDlgWithCallback(rundialog, hostWindow.buildWinName(null), 615, 480,function(){Xrm.Utility.openEntityForm(objectTypeCode,primaryEntityId)})
        }         
}
Everything works fine but the Case form is not reloaded after the Dialog is over. If I manually refresh the browser I can see the Case record was indeed cancelled as expected. I tried the code in Chrome and IE and nothing occurs at the end of the Dialog, I mean, the form is still opened with the old status (Active). What am I doing wrong? The CRM version is 2016 Update 1 Online but this should work in 2016 OnPremise, too.
Any suggestion would be much appreciated.
Xavier Villafuerte

*This post is locked for comments

  • Xavier Villafuerte Profile Picture
    Xavier Villafuerte 350 on at
    RE: Form is not reloaded after Dialog execution

    Hi Umer, sorry for the late response. As far as I remember, we ended changing Dialogs for other solution because they are a deprecated feature in newer versions.

  • Umer990 Profile Picture
    Umer990 46 on at
    RE: Form is not reloaded after Dialog execution

    Hi,

    Have you ever get it solved?

  • Umer990 Profile Picture
    Umer990 46 on at
    RE: Form is not reloaded after Dialog execution

    Hi,

    Have you ever get it solved?

  • Umer990 Profile Picture
    Umer990 46 on at
    RE: Form is not reloaded after Dialog execution

    Hi,

    Have you ever get it solved?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans