To call a workflow from a form button, we need to create a button in the form and call the javascript function launchOnDemandWorkflowForm
To call a workflow from a grid button, we need to create a button in the grid and call the javascript function launchOnDemandWorkflow//when called from en***y form
launchOnDemandWorkflow(“”,ObjectTypeCode,Workflow ID)//Example
launchOnDemandWorkflowForm("",10032,"{154599DD-B20B-4F72-8771-CA93C660C820
//when called from grid
launchOnDemandWorkflow('crmGrid',ObjectTypeCode,Wo rkflow ID)//Example
launchOnDemandWorkflow(““,10032,"{154599DD-B20B-4F72-8771-CA93C660C820}");
We can also use the direct workflow dialog.Like
"/_grid/cmds/dlg_runworkflow.aspx?iObjType=1090&iTotal=1&wfId=% 7B15B4EB9B-5C68-46DE-8BFC-A0F4B0A29523%7d"
but you need to use CrmUrlEncode function to pass the values