How to Refresh the parent Form in CRM Dynamics 5.0 after action is completed on custom child form?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:55:20

问题


I have a parent form called ISSUE. This Issue form has a button called IG on the Form Ribbon that opens custom Html Page.

Now after the Submit button is clicked on the Custom form that performs some Inserts into CRM and Closes directly. Now I want to refresh the parent ISSUE form on closing the child HTML Page to reflect my Inserts.

Here is the code that i used to call the Child Form on clicking IG Button from the Issue Form Ribbon:

function popup()
{
    var url = './WebResources/irpc_/planner.html';

    var data =
    {
        issueGuid: Xrm.Page.data.entity.getId(),
        causeCodeGuid: Xrm.Page.data.entity.attributes.get("irpc_causecode").getValue()[0].id,
        riskClassificationId: Xrm.Page.data.entity.attributes.get("irpc_riskclassification").getValue()
    };

    window.showModalDialog(url , data, 'dialogHeight:480px;dialogWidth:1200px;');

}

Appreciate your help.

Thanks


回答1:


You could try:

window.location.href = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search

This will input the same URL minus the hash/fragment. I'm assuming CRM 5 still uses a fragment which would prevent the page from refreshing if you just did a window.location.href = window.location.href.

Caveats:

  1. If there is dirty data on the form, you're going to get a dirty data warning.



回答2:


 well, you can use the following line of code.

 window.location.reload(true);


来源:https://stackoverflow.com/questions/4094058/how-to-refresh-the-parent-form-in-crm-dynamics-5-0-after-action-is-completed-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!