The issue which raised the need to explore the XAML features of the workflow (Business Process Flow) in CRM was the out-of-the-box BPF (Business Process Flow) ‘Lead to Opportunity Sales Process’ which has some unique features that can’t be replicated if you try to create the same BPF from scratch. The ‘Lead to Opportunity Sales Process’ automatically filters the lookup in the process bar for the existing account and existing contact based on the Lead name and organization name on the Lead record. If you create a new BPF for the Lead entity and can’t find the ‘Existing Account’ and ‘Existing Contact’ available under the Value column in the BPF, then the below process can help you re-create the functionality you get with these virtual fields.
The ‘Existing Account’ and ‘Existing Contact’ field are actually mapped to ‘parentaccountid’ and ‘parentcontactid’ fields on the Lead entity. If you cannot select the ‘Existing Contact’ and ‘Existing Account’ virtual fields on the BPF, then use the ‘Parent Account’ and ‘Parent Contact’. When using these fields, you don’t get the functionality that they pre-filter the lookup based on the Lead name and Organization name on the Lead record. The below process will help you restore this feature.
There aren’t any UI elements in the BPF definition that you can change to make it work, so the next step would be to export just the BPF in an unmanaged solution. Once you have the solution file, then unzip to review the components within the solution file, and you will see a folder for Workflows. (As shown below.)
In the Workflows folder, you will find the BPF definition within a XAML definition file. In CRM, you can create custom XAML workflow using Visual Studio Developer Toolkit. In this instance, we will just modify the XAML definition file in a text editor. In the text editor, search for “parentcontactid” or “parentaccountid” and you will find something similar to this:
In order to achieve the auto filter on this field, you will need to modify it to look like this:
We added in the parameters section and set the ‘IsDeDupLookup’ flag to ‘True’, and also removed the existing ‘mcwb:Control.Parameters’ section. Once you make these changes, you can re-create the solution file and upload it back into CRM. To keep things simple, only include the BPF process in the solution when exporting from CRM. If you don’t want to go through all this hassle, then remember to always make a copy of the OOB BPF and then modify it to your needs to maintain any of the unique features that only exist with the OOB BPF.
[avatar user=”dvora” size=”thumbnail” align=”left” /]DAVE VORA | Senior Business Software Consultant/ CRM Lead
Dave is responsible for leading KTL’s CRM consultants, assuring that our solution scoping, architecting and delivery meet and exceed customer expectations. Dave has built lasting relationships with clients by understanding their business needs and providing value by leveraging their existing resources. Along with his consulting team, he has delivered effective solutions beyond traditional CRM constraints. Dave has more than eight years of experience in implementing business software for a variety of industries, including service, government, distribution, not-for-profit and manufacturing. He graduated with a Bachelor of Science Degree in Computer Science and also a specialization in Management from University of California at Irvine. His experience includes helping companies embrace technology to fulfill their organizational needs and creating innovative solutions using CRM, GP, Scribe and other Microsoft products.