locked
Dialog Boxes? RRS feed

  • Question

  • I was assuming that "Dialog" under the Processes window was for these, but obviously that's not the case.

    I have "Integration Mode" enabled for our CRM, which replaces "activate order" with "Submit order", which then locks it so that it can only be modified in the back-office (Dynamics NAV in this case)

    We would like it so that if there are any write-in products in the order, that when hitting "Submit order", a dialog box pops up saying "You have write-in products, are you sure you want to submit the order?" with yes/no as options.  If the user presses yes, it will act as normal, if they click no it will return to the form without submitting it.

    Is something like this possible? If so, how do I do it? I know next to nothing about code so if it involves Javascript I will need some help.

    Tuesday, February 19, 2013 11:17 PM

Answers

  • Sure! First of all to create and edit new buttons on the ribbon download this solution. Then, run and connect to CRM. Select the entity you want. Create your desired button with its picture. Then from actions of the button you could define a java script. Your javascript may look like:

    funtion onclick() {

    window.open("/"+Xrm.Page.context.getOrgUniqueName()+"/cs/dialog/rundialog.aspx?DialogId=%7b33F4B316-ACB3-4593-A10D-D9F556A7F3F7%7d&EntityName=task&ObjectId=" + Xrm.Page.data.entity.getId());

    }

    You have to replace the dialog id. Find your dialog and press F11, the page goes to full screen! Find the id at the address bar! Replace it with you which is on the script. Change the entity name to which you want. Use schema name for it. Save changes and publish customizations! This is all of the scenario!


    If the answer helped you, remember to mark it as answer.

    Wednesday, February 20, 2013 5:31 AM
    Moderator
  • You'll need to create your own button and hide the system button as Payman mentioned.  You will be able to perform this step once that is done:

    Then from actions of the button you could define a java script. Your javascript may look like:

    funtion onclick() {

    window.open("/"+Xrm.Page.context.getOrgUniqueName()+"/cs/dialog/rundialog.aspx?DialogId=%7b33F4B316-ACB3-4593-A10D-D9F556A7F3F7%7d&EntityName=task&ObjectId=" + Xrm.Page.data.entity.getId());

    }


    Regards, Donna

    Wednesday, February 27, 2013 1:21 PM

All replies

  • Hi,

    Running a dialog or calling from custom ribbon button is possible. Please go through the following links.

    http://mscrmshop.blogspot.in/2011/06/how-to-start-dialog-from-application_08.html

    http://crmmongrel.blogspot.in/2011/06/launch-dialog-from-ribbon-button-in-crm.html

    http://ankit.inkeysolutions.com/2012/01/crm-2011-how-to-launch-dialog-on-click.html

    http://stackoverflow.com/questions/14482498/javascript-confirmation-on-crm-2011-ribbon-system-button

    http://ayazahmad.wordpress.com/2010/09/21/call-scripting-in-microsoft-crm-2011/

    http://garethtuckercrm.com/2011/02/22/launching-a-dialog-from-a-ribbon-button-in-crm-2011/


    Thanks & Regards, MS CRM Consultant, V.Surya. My Blog: http://inventcrm.wordpress.com/

    • Proposed as answer by Minal Dahiya Wednesday, February 20, 2013 4:24 AM
    Wednesday, February 20, 2013 2:27 AM
    Answerer
  • You could run dialog on change event of a form. To do this you could use:

    window.open("/"+Xrm.Page.context.getOrgUniqueName()+"/cs/dialog/rundialog.aspx?DialogId=%7b33F4B316-ACB3-4593-A10D-D9F556A7F3F7%7d&EntityName=task&ObjectId=" + Xrm.Page.data.entity.getId());

    Replace the diaog id and entity name, then it works with an on change or on load or etc event of a form. Furthermore, if you add a new ribbon button with solution such as Visual Ribbon Editor, then you could put this action on that button.


    If the answer helped you, remember to mark it as answer.


    Wednesday, February 20, 2013 5:12 AM
    Moderator
  • I don't really know how to make dialogs though, the interface is far too confusing.

    And those links involve a high level of programming knowledge which I don't have.  Can somebody make this simpler for me? I gave all the information that should be needed for this...

    Wednesday, February 20, 2013 5:22 AM
  • Sure! First of all to create and edit new buttons on the ribbon download this solution. Then, run and connect to CRM. Select the entity you want. Create your desired button with its picture. Then from actions of the button you could define a java script. Your javascript may look like:

    funtion onclick() {

    window.open("/"+Xrm.Page.context.getOrgUniqueName()+"/cs/dialog/rundialog.aspx?DialogId=%7b33F4B316-ACB3-4593-A10D-D9F556A7F3F7%7d&EntityName=task&ObjectId=" + Xrm.Page.data.entity.getId());

    }

    You have to replace the dialog id. Find your dialog and press F11, the page goes to full screen! Find the id at the address bar! Replace it with you which is on the script. Change the entity name to which you want. Use schema name for it. Save changes and publish customizations! This is all of the scenario!


    If the answer helped you, remember to mark it as answer.

    Wednesday, February 20, 2013 5:31 AM
    Moderator
  • Great, I will try it out when I get to work and let you know how it goes!
    Wednesday, February 20, 2013 5:37 AM
  • OK, now my question is how to make the actual dialog do what I want it to do?

    I got the Visual Ribbon Editor to connect to the CRM server and opened up the form:

    But it's saying I can't edit system buttons.  Would I just create a new button with the same name and picture and hide the regular one?  It looks like the Submit Order button runs a Javascript file called submitorder.js... so would I basically have the dialog run that when you click Yes?

    I'm a bit confused how to make the dialog part, if someone could help me make that, that would be great!

    Wednesday, February 20, 2013 2:37 PM
  • You'll need to create your own button and hide the system button as Payman mentioned.  You will be able to perform this step once that is done:

    Then from actions of the button you could define a java script. Your javascript may look like:

    funtion onclick() {

    window.open("/"+Xrm.Page.context.getOrgUniqueName()+"/cs/dialog/rundialog.aspx?DialogId=%7b33F4B316-ACB3-4593-A10D-D9F556A7F3F7%7d&EntityName=task&ObjectId=" + Xrm.Page.data.entity.getId());

    }


    Regards, Donna

    Wednesday, February 27, 2013 1:21 PM