开发者

Dynamics CRM MessageBox

开发者 https://www.devze.com 2023-03-03 06:18 出处:网络
I have some JavaScript in Dynamics that does some work and needs to prompt the user with a Yes/No question.

I have some JavaScript in Dynamics that does some work and needs to prompt the user with a Yes/No question.

I'd like to have the popup themed like the rest of Dynamics.开发者_C百科 Is there any page I can use with window.ShowModalDialog or some part of the API to provide a standard looking Dynamics message box?

Thanks.


there isn't a built-in feature to prompt the user in Dynamics CRM using javascript, however, you could build one the use the OpenDialog function to prompt it like Dynamics CRM does using one of these JS functions

Xrm.Utility.openDialog //2016
Xrm.Internal.openDialog //2015 - 2013

Hope it helps


No, CRM doesn't have any function like that built in. You'll have to create your own page.


Maybe you can use a managed solution here https://alertjs.codeplex.com/


The latest Javascript API has the following method, its simple and amazing.

var confirmStrings = { text:"This is a confirmation.",cancelButtonLabel:"No", title:"Confirmation Dialog" };
var confirmOptions = { height: 200, width: 450 };
Xrm.Navigation.openConfirmDialog(confirmStrings, confirmOptions).then(
function (success) {    
    if (success.confirmed)
        console.log("Dialog closed using OK button.");
    else
        console.log("Dialog closed using Cancel button or X.");
});


Maybe you can use "dialogs" and trigger that to open by using a javascript?


You can use the dialog template found in the SDK to create a dialog with CRM 4.0 look and feel: (SDK Path)\visualstudiotemplates\cs\addonwebpage


Hope that the below code snippet would be helpful

protected void doBatch()
{
    if (Box::yesNo("Vent radioactive gas?", DialogButton::No) == DialogButton::Yes)
    {
        super();
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消