Quantcast
Channel: Sam's Activities
Viewing all articles
Browse latest Browse all 3363

Save and refresh record entity after finishing dialog process

$
0
0

Hi All, I have created a dialog process, I call it when a button on the ribbon is clicked.
I wanna when dialog has finished its job( the dialog window closed and finished) the record entity save and reload.

Here is the code that run the dialog :

(function() {
Develop1_RibbonCommands_runDialogGrid = function(ids, objectTypeCode, dialogId) {
    if ((ids == null) || (!ids.length)) {
        alert(window.LOCID_ACTION_NOITEMSELECTED);
        return;
    }
    if (ids.length > 1) {
        alert(window.LOCID_GRID_TOO_MANY_RECORDS_IWF);
        return;
    }
    var rundialog = Mscrm.CrmUri.create('/cs/dialog/rundialog.aspx');
    rundialog.get_query()['DialogId'] = dialogId;
    rundialog.get_query()['ObjectId'] = ids[0];
    rundialog.get_query()['EntityName'] = objectTypeCode;
    openStdWin(rundialog,buildWinName(null),615,480,null);
}
Develop1_RibbonCommands_runDialogForm = 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.openStdWin(rundialog, hostWindow.buildWinName(null), 615, 480, null);
            // window.location.reload(true);
        } 

}
})();

Depending on this source code, how can it be possible?


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>