locked
How do I use the ribbon workbench? RRS feed

  • Question

  • I have a custom activity entity called "Payment"; I've added a button using ribbon workbench, but what's the command I issue to load up my custom activity entity for a particular record? I don't want an empty record to open empty, but the regarding field set in the new activity.
    Thursday, May 16, 2013 12:49 PM

Answers

  • Hi,

    If I understand you correctly, you'd like to add a custom button that adds a custom activity record to another entity rather than using the 'Other Activities' fly-out anchor that is created by CRM by default?

    You can easily create your own button to add an entity by creating a new command that calls the 'Mscrm.RibbonActions.addActivityOnForm' or 'Mscrm.GridRibbonActions.addActivityFromGrid' functions in /_static/_common/scripts/RibbonActions.js.

    The easiest way of doing this is by using one of the out of the box commands and modifying it.

    1) Load the entity into the Ribbon Workbench for Dynamics CRM

    2) Open the Home Page ribbon 

    3) Select the'Add' Tab

    4) Select the 'Task' button and use 'right click' -> 'Customise Command' (NOT 'Customise Button'). This step is to get a copy of the command used to add activities.

    5) Find the command in the 'Solution Elements->Commands'

    6) Rename it to 'new.AddCustomActivityToSelectedRecord'  -or something similar

    7) Modify the int parameter from 4121 to the ID of your custom activity.

    8) Create a new button and associate with this command.

    9) Repeat for the Form Ribbon

    So the great thing about this method is that you don't need to add any custom Javascript - although that's a perfectly acceptable method as well.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, May 17, 2013 7:42 AM
    Answerer

All replies

  • Thanks for the post, but I read those articles and still haven't worked it out. There is something that I'm missing here.
    Thursday, May 16, 2013 1:08 PM
  • Hi 

    What value you want to set in the regarding field. I think you have to create a JScript webresource and do your logic in there. You can call JScript function in ribbon. 

    Thanks

    Thursday, May 16, 2013 1:14 PM
  • Hi,

    please use ribbon editer tool.


    vasubabuk

    Thursday, May 16, 2013 1:15 PM
  • It's a custom activity entity that I created. I have my entity placed under "Other Activities" already, but I would like to give it it's own button. For instance in the picture, my custom activity entity is called "Payments" and it's a sub menu under "Other Activities", but I would like the button I created "Add Payment", when clicked to open up the same form "Payments".

    Thursday, May 16, 2013 1:20 PM
  • Hi,

    In SDK we had ribbon editor tool .please use that .we can create a new botton and we make action for that botton.


    vasubabuk

    Thursday, May 16, 2013 1:23 PM
  • I have achieved the similar kind of problem by creating a JScript function and called it from the button Action.

    Here is sample code,

    OpenWindow = function (fieldName) {
        
        var OrgName = Xrm.Page.context.getOrgUniqueName();
        var serverUrl = Hansa.Crm.Utilities.getServerUrl();

        sURL = serverUrl + "provide other attributes/values"
        
        window.open(sURL, "_blank", "width=900px,height=600px,resizable=1");
    };

    • Proposed as answer by faisalkhan001 Thursday, May 16, 2013 1:34 PM
    Thursday, May 16, 2013 1:34 PM
  • Hi,

    If I understand you correctly, you'd like to add a custom button that adds a custom activity record to another entity rather than using the 'Other Activities' fly-out anchor that is created by CRM by default?

    You can easily create your own button to add an entity by creating a new command that calls the 'Mscrm.RibbonActions.addActivityOnForm' or 'Mscrm.GridRibbonActions.addActivityFromGrid' functions in /_static/_common/scripts/RibbonActions.js.

    The easiest way of doing this is by using one of the out of the box commands and modifying it.

    1) Load the entity into the Ribbon Workbench for Dynamics CRM

    2) Open the Home Page ribbon 

    3) Select the'Add' Tab

    4) Select the 'Task' button and use 'right click' -> 'Customise Command' (NOT 'Customise Button'). This step is to get a copy of the command used to add activities.

    5) Find the command in the 'Solution Elements->Commands'

    6) Rename it to 'new.AddCustomActivityToSelectedRecord'  -or something similar

    7) Modify the int parameter from 4121 to the ID of your custom activity.

    8) Create a new button and associate with this command.

    9) Repeat for the Form Ribbon

    So the great thing about this method is that you don't need to add any custom Javascript - although that's a perfectly acceptable method as well.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, May 17, 2013 7:42 AM
    Answerer
  • Thank you Scott for the reply, I managed to work out the problem. Essentially I just copied the details from an existing command and used that instead. 

    The app is genius, but moreover your support for your app is like non other. I knew you would reply to this thread.

    Thanks again.

    Friday, May 17, 2013 10:29 AM
  • Hi,

    You mean the Task button and the new custom button both open the Payment form?

    If this is this is the case, it means that perhaps you didn't rename the command?

    Could you post your ribbon xml for the command?



    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, May 17, 2013 10:39 AM
    Answerer
  • You are welcome - and thanks for those kind words! 

    Really glad you got it sorted.


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Friday, May 17, 2013 10:53 AM
    Answerer
  • sir, i want to create an entity "Vehicle" and it must display as unique entity as "Sales" entity not to come under in any areas.

    it must be a unique. please help me sir as soon as possible

    Wednesday, May 21, 2014 11:50 AM
  • Thanks for this walkthrough, fantastic stuff. Made something that I thought was going to be very hard, very easy.

    The only thing I would add is that you need to go back to the Task button you "Customised Command" on and make sure you change the Command behaviour to the top selection in the drop down, so nothing is actually selected.

    Thanks again.

    Wednesday, July 16, 2014 3:36 AM