Jeff
Jeff

Reputation: 36553

Dynamics CRM MessageBox

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. 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.

Upvotes: 1

Views: 1215

Answers (7)

Hector Mejia
Hector Mejia

Reputation: 11

Hope that the below code snippet would be helpful

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

Upvotes: 0

Preshma Linet Pereira
Preshma Linet Pereira

Reputation: 350

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.");
});

Upvotes: 1

PhuocLe
PhuocLe

Reputation: 131

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

Upvotes: 1

Marcelo Acosta
Marcelo Acosta

Reputation: 189

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

Upvotes: 2

Nils Georg
Nils Georg

Reputation: 1

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

Upvotes: 0

Peter
Peter

Reputation: 1

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

Upvotes: 0

Matt
Matt

Reputation: 4686

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

Upvotes: 1

Related Questions