Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics CRM 2016: Alert.js And Ribbon Workbench 2016

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello, 

I've created a button using Ribbon workbech ,

 this button shows an Alert , 

for the alert i'm using : Alert.js https://alertjs.codeplex.com/documentation

specially the method : 

Alert.showWebResource(webResourceName, width, height, title, buttons, baseUrl, preventCancel, padding)

this methode contain a paramter :

buttons

  • Type: Array of Alert.Button objects.

My question is : how to create a parameter with an object as Type ??
thank you

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics CRM 2016: Alert.js And Ribbon Workbench 2016

    It works , thank you :)

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Dynamics CRM 2016: Alert.js And Ribbon Workbench 2016

    Hi,

    This actually shows up in the documentation.

    var myButtons = [

       new Alert.Button("Create Sale", createSaleFunction, true),

       new Alert.Button("Not now")

    ];

    The following is the function call for each Alert.Button:

    new Alert.Button(label, callback, setFocus, preventClose)

    label (String): The text to display on the button.

    callback (function): A custom function to call when the button is clicked. This function accepts no input parameters, and can be declared inline as a dynamic function. A callback is not required, as the button can still close the alert by default (unless you specify otherwise).

    setFocus (bool): Specify whether this button should have focus set to it by default, i.e. to allow pressing 'enter' to fire the button command. If there is only one button, focus is automatically set to the button, unless you explicitly set this to false.

    preventClose (bool): Specify whether this button should not close the alert after executing the callback function. By default, if this value is not specified, the alert will be automatically closed after clicking the button. Set this to true if you want to keep the alert open, for example if your button does something like the 'download log' for CRM errors, where you want to keep the error open.

    Good luck

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans