web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

add custom button that workflow run it

(0) ShareShare
ReportReport
Posted on by

hi, 

i need to have custom button in crm form ,when click on it some workflow  start to run , i dont know how can i add new button and how can i related to my workflow  or plugin ? (i want when this button clicked,  add record of child to my child entity attomaticlly),

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Somayeh,

    Its a little complex requirement and involves a bit of custom implementation. Below are the high level steps which you would need to achieve this functionality-

    1.) You first need to create a workflow to achieve your requirement. It is not clear what do you mean by "add record of child to my child entity attomaticlly" so if you could share some more details, I/we can help you with it.

    2) Once you are done with the workflow, test it just by running it on demand. once you are satisfied that workflow is working fine, you can then use ribbon workbench to call this workflow from a ribbon button.

    I have seen you asked the same question before as well so I would suggest you to first complete the workflow part and then deal with calling it from ribbon button.

    Hope this helps.

  • Verified answer
    Piyush Paliwal Profile Picture
    817 on at

    Hi Somayeh,

    You need to do the following steps

    1. Create a blank solution in CRM
    2. Add the entity on which you need the button to the solution you created above.
    3. Use Ribbon Workbench to create a button. Follow the getting started guide which explains all of it https://ribbonworkbench.uservoice.com/knowledgebase/articles/71374-1-getting-started-with-the-ribbon-workbench#Adding_a_button_to_the_Ribbon
    4. Create an On-Demand workflow in CRM and add this workflow to the solution, you can refer this guide https://ledgeviewpartners.com/blog/create-run-demand-dynamics-365-workflows/
    5. In the workflow logic, if you are following the guide I mentioned above, instead of choosing Update record, you need to select Create Recordstep.
      1. Map all the fields you want by clicking the Properties button on the step.
      2. Please ensure you map the relationship by filling in the parent entity lookup from dynamic values. Note: this is very important if you want to have this record show up in sub-grids.
    6. Create a JavaScript web resource and write a script that will execute the workflow for you. Refer this guide, https://www.ashishvishwakarma.com/executing-workflows-using-javascript-c-sharp-example-dynamics-365/
    7. Finally, call the script you created in Step 6 from the Ribbon button command using Ribbon Workbench.

    Let me know if this helps.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    If you have on demand workflow then it is available on form, There is no need to add extra button.

    4762.Capture3.JPG

    That is different thing if you want to run multiple workflows on same record on a button click. In this case you have to add custom button.

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    You should meet the following 3 conditions.

    1.Custom Button

    You could use Ribbon Workbench  to add custom ribbons on the form.

    Please refer to the link and learn how to add buttons and associate with workflow.

    How to setuphttps://community.dynamics.com/365/b/softchiefmicrosoftdynamics365/archive/2017/03/24/how-to-setup-ribbon-workbench

    How to add ribbonhttps://ribbonworkbench.uservoice.com/knowledgebase/articles/132235-create-a-workflow-short-cut-ribbon-button-no-code

    2.Custom workflow

    You could develop your custom workflow using C#.

    Here is the guide of Development.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/workflow/create-custom-workflow-activity

    3.Register workflow

    You should use Plug-in Registration Tool to register your workflow to Dynamics 365.

    You could refer to this link to learn how to use this tool.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/walkthrough-register-plugin-using-plugin-registration-tool

    Hope it helps.

    Best Regards

    Leo

  • Community Member Profile Picture
    on at

    thanks ravi , i'm trying to do it

  • Community Member Profile Picture
    on at

    thank you Rocker , yes i need it, because of user must see the button on the form and click it and run workflow ,  its not user friendly for user to run workflow and select the true one  

  • Community Member Profile Picture
    on at

    hi Piyush  , i did step of 1 to 4 and i did not know how can i do step 5 and 6 , i will try to do this step and i think this is my problem

    thank you a lot for complete answer

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    You can follow below steps to add a button:

    community.dynamics.com/.../call-workflow-directly-from-a-button-using-ribbon-workbench

  • Community Member Profile Picture
    on at

    thanks a lot Leo

  • Community Member Profile Picture
    on at

    thansk Piyush Paliwal , but i just have a  problem with step 5 , i could add record to child entity with workflow step but after added the new  record i want my child  subgrid show the created record but after refresh the page i can see the new recordes . could you please explain more if possible ?

    thanks a lot  for your answer  

    somayeh

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans