Run Workflow Using Short Cut Ribbon Button (Without Coding)
Challenge:
Don't you find users are always complaining about the 'number of
clicks' it take to do things? Although, the standard Run Workflow
button provides a lookup to find a particular workflow to run, it
would be nice to provide 'short-cut' buttons to run commonly used
workflows.
Solution:
- Open the Process Centre Workflow in the designer and press
'F11' to show the address bar - then copy the URL.
It should look something like:
http://<Server>/<OrgName>/sfa/workflow/edit.aspx?id=%7b<WorkflowID>%7d
- Extract the Workflow ID from the url and save for later.
- Create a solution and add the Contact Entity along with the
ribbon button images that you want to use on your button.
- Load the new solution into the Ribbon Workbench.
- In the 'Solution Element' panel, add the following
EnableRules and mark each one as 'IsCore=True' in the
properties.
-Mscrm.SelectionCountAtLeastOne
-Mscrm.RunWorkflowSelected
-Mscrm.FormStateNotNew
-Mscrm.RunWorkflowPrimary
6. Under 'Commands' in the Solution Elements Panel, add two
Commands and name them something like:
-new.contact.Form.RunWorkflow1.Command
-new.contact.Grid.RunWorkflow1.Command
-new.contact.Form.RunWorkflow1.Command
-new.contact.Grid.RunWorkflow1.Command
7. Right-Click on the Command
'new.contact.Form.RunWorkflow1.Command' and select 'Edit Enable
Rules'
Add the following Enabled Rules:
-Mscrm.FormStateNotNew
-Mscrm.RunWorkflowPrimary
Add the following Enabled Rules:
-Mscrm.FormStateNotNew
-Mscrm.RunWorkflowPrimary
This will ensure that the button is only enabled if workflows
can be run on the current record.
8. Right-Click on the Command
'new.contact.Grid.RunWorkflow1.Command' and select 'Edit Enable
Rules'
Add the following Enabled Rules:
-Mscrm.SelectionCountAtLeastOne
-Mscrm.RunWorkflowSelected
Add the following Enabled Rules:
-Mscrm.SelectionCountAtLeastOne
-Mscrm.RunWorkflowSelected
This will ensure that the button will only be enabled if there
are records selected and they can have workflows run on them.
9. This is where the magic happens:
Right-click on the Command 'new.contact.Grid.RunWorkflow1.Command' and select 'Edit Actions'
Add a JavaScript Command and set the following properties:
Right-click on the Command 'new.contact.Grid.RunWorkflow1.Command' and select 'Edit Actions'
Add a JavaScript Command and set the following properties:
10. Rigth-click on the Command 'new.contact.Form.RunWorkflow1.Command'
and select 'Edit Actions'
Add a JavaScript Command and set the following properties:
Adding the Buttons
- Select the 'Home Page' ribbon using the drop down in the top right of the design surface.
- Drag a new button on to the 'Process' Group
Give your buttons an image, and select the Command
'new.contact.Grid.RunWorkflow1.Command'
3. Select the 'SubGrid' ribbon and drag a new button into the
'Process' Group
Give your buttons an image, and select the Command
'new.contact.Grid.RunWorkflow1.Command'
4. Select the 'Form' ribbon and drag a new button into the
'Process' Group
Give your buttons an image, and select the Command
'new.contact.Form.RunWorkflow1.Command'
5. Click 'Publish'.
Thank You
Great help.
ReplyDelete