Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

while customizing the command using ribbon workbench?

Posted on by

Hello All Experts,

My javascript is not getting loaded in debugger tool.

i have customized the command using ribbon workbench for Close as Won button.

can anybody let me know what is getting wrong in this.

Below is screeshot for command setting.

MarkAsWon.PNG

below is the JavaScript sample code.

//Check Data Availability.
function CheckDataAvailable(PrimaryEntityTypeCode,boolValue)
{
console.log(method called.);
if(1==1)
{
Xrm.Utility.alertDialog("Do you want to Continue Close As Won.",NoTaskCreated());
}
else
{
console.log('Nothing Happens');
}
}

function NoTaskCreated(){
Xrm.Utility.alertDialog("Dialogue Closed");
}

*This post is locked for comments

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: while customizing the command using ribbon workbench?

    Hello Alex,

    Mscrm.Form.opportunity.MarkAsWon

    this is the problem and i have got it.

    code is just sample , actual code i didn't paste here.

    Thanks all of you guys.

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: while customizing the command using ribbon workbench?

    Actually, there is one more issue:

    console.log(method called.);

    There should be quotes aroound "method called"

    With those two changes (and with that form command), it works on the form - just confirmed in my trial

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: while customizing the command using ribbon workbench?

    Hello,

    I see one issue in your code. Instead of using

    Xrm.Utility.alertDialog("Do you want to Continue Close As Won.",NoTaskCreated());

    try to use

    Xrm.Utility.alertDialog("Do you want to Continue Close As Won.",NoTaskCreated);

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: while customizing the command using ribbon workbench?

    Hello Alex,

    I was looking it at the Home side , now i have checked it on the Form side on Ribbon workbench and trying to customize it.

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: while customizing the command using ribbon workbench?

    Hi,

     are you customizing the grid or are you customizing the form?

     That command is for the grid, I believe. There is another one for the form:

    Mscrm.Form.opportunity.MarkAsWon

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: while customizing the command using ribbon workbench?

    Hello Thomas,

    I have added the debugger but not of use.

    it's not working.

    is there any other way to handle this.

  • Thomas David Dayman Profile Picture
    Thomas David Dayman 11,323 on at
    RE: while customizing the command using ribbon workbench?

    Try and add a

    debugger;


    statement to you code where you want it to break point. Hopefully it should pick it up when you click the Ribbon Button

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans