Showing posts with label workflow. Show all posts
Showing posts with label workflow. Show all posts

Tuesday, August 27, 2013

CRM 2011 Process Dialogs - Use them

How often haven't you been asked for a new custom form to consolidate related entities for data capture?
Quite often i guess. Me too.

I recently wanted to bring something "new" into considerations for a client who was stocked in the decisions process for user friendly layouts.
The standard entity forms became too overwhelming in number of clicks and different forms popping up during the process of capturing data to Account, Contact, Opportunity and a custom entity. After quite a few iterations of presenting mock ups, discuss the adjustments to meet an acceptable usability level, modifying mock ups, presenting again and so forth - I brought in the suggestion of using process dialogs.
And to my surprise the feature was accepted after 10 minutes with the following argumentation:

  • Full control for system administrators to add or modify process dialogs
  • Flexible way of building up data entry forms for a specific purpose and with context driven tips added to each control
  • Out of the box functionality that assumably is compatible for future releases of Microsoft Dynamics CRM
Totally under judged be my and most of my fellow colleagues.

Here are some tutorials from around the web that illustrates the advantages and limitations of using process dialogs:
  • https://community.dynamics.com/crm/b/crmteamblog/archive/2011/02/02/welcome-to-the-world-of-dialogs-part-1.aspx#.UhxLERbFbGw
  • http://intellicore-ltd.blogspot.dk/2012/12/workflows-vs-dialogs-microsoft-dynamics.html
And if you want to bring it a step further having buttons to activate a specific process dialog without going into the entity for the dialog:
  • http://barrycrm.wordpress.com/2013/07/30/how-to-initiate-a-dialog-from-a-custom-button

Saturday, November 22, 2008

Execute workflow from ISV button

To optimize the user experience some of the workflows that are executed on demand might be put into an ISV button on the entity form.
Here is what to do:


Go to settings/customization
Open the entity and select the form in the forms/view section
Open the forms onload event
Copy the code below and paste it in at the end of what ever might be in the editor window


"/* the function */
ExecuteWorkflow = function(entityId, workflowId)
{
var xml = ''  
''  
'<?xml:namespace prefix = soap /><soap:envelope xsd="\'http://www.w3.org/2001/XMLSchema\'" xsi="\'http://www.w3.org/2001/XMLSchema-instance\'" soap="\'http://schemas.xmlsoap.org/soap/envelope/\'">'  
GenerateAuthenticationHeader()  
' <soap:body>'  
' <execute xmlns="\'http://schemas.microsoft.com/crm/2007/WebServices\'">'  
' <request type="\'ExecuteWorkflowRequest\'">'  
' <entityid>'   entityId   '</entityid>'  
' <workflowid>'   workflowId   '</workflowid>'  
' </request>'  
' </execute>'  
' </soap:body>'  
'</soap:envelope>'  
'';

var xmlHttpRequest = new ActiveXObject('Msxml2.XMLHTTP');
xmlHttpRequest.Open('POST', '/mscrmservices/2007/CrmService.asmx', false);
xmlHttpRequest.setRequestHeader('SOAPAction','http://schemas.microsoft.com/crm/2007/WebServices/Execute');
xmlHttpRequest.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xmlHttpRequest.setRequestHeader('Content-Length', xml.length);
xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;
return(resultXml.xml);
}"




After save the form and publish the entity
Export the ISV config File and open it in notepad.
For the entyform you want to execute the workflow from, enter the nodes below:


"<entity name="'account'">
<toolbar validforcreate="'0'" validforupdate="'1'">
<Button Icon='/_imgs/ico_16_exportCustomizations.gif'
JavaScript='
var theWorkflowId = '3FD2DD58-4708-43D7-A21B-F0F90A0AA9F2';  
ExecuteWorkflow(crmForm.ObjectId, theWorkflowId); 
window.location.reload();}'>
<titles>
<title lcid="'1033'" text="'Run">
</titles>
<tooltips>
<tooltip lcid="'1033'" text="'Run">
</tooltips>
</button>
</toolbar>
</entity>"




Import the ISV.Config into CRM
Open the form and run your workflow directly from the form.