0
votes

I am trying to write a custom plugin for Microsoft Dynamics CRM 2013. We are running On Premises. I created a custom c# web project to add Products to a Quote more quickly. The web page is launched as a modal page from the ribbon. (I used the Ribbon Workbench 2013). All back-end functionality works fine on the new modal form, but as I add Products to the Quote I would like the Product sub-grid on the Quote form to refresh Automatically.

1

1 Answers

0
votes

Did you try "refresh" method of "Xrm.Page.ui.controls"?

Like:

var ctrl = Xrm.Page.ui.controls.get("SubGridName");
ctrl.refresh();

http://msdn.microsoft.com/en-us/library/gg334266.aspx

By clicking a button you must execute a custom javascript code. After closing modal window add code specified above.

UPD.

1) We need to create "JScript" web resource ("/script/myCustomScript.js")

Like that:

function onClickRibbonButton1()
{    
    // show modal dialog
    window.showModalDialog('https://serverurl/custompage.html');
    // after closing - refresh sub grid
    var ctrl = Xrm.Page.ui.controls.get("SubGridName");
    ctrl.refresh(); 
}

2) In Workbench specify following:

Ribbon Workbench