Modify Maximum Active Business Process Flows allowed per entity in Dynamics 365

By | April 18, 2017

Introduction:

Business Process Flow was introduced around CRM 2013. Business Process Flows can be used a guide to assist the users with the business process to be followed. Take for example Lead; your business could define the various stages and actions that need to be performed before a lead is qualified. To ensure that these steps are not missed, business process flows can be designed and activated so that they show up on the entity forms to guide the users on the process to be followed.

In the initial release, we were limited to only having one BPF active per record. Also, the count of business process flows that could be designed and activated per entity were restricted to 10.

New Updates:

With Dynamics 365 (8.2) release, the platform team has now provided an option to control the count of the active business process flows allowed per entity.

This counter is now available at the Organization level and can be found in the “maximumactivebusinessprocessflowsallowedperentity” attribute.

There is no way at the moment in UI to change the count, but being stored in the Organization entity, we can perform the usual CRM updates to Organization entity to modify the count.

Code Snippet:

The below demonstrates retrieving of the organization entity and updating the maximumactivebusinessprocessflowsallowedperentity to 11.

C#:

//use fetchxml for retrieving Orgainzation entity.
string fetch = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='organization'>
               <attribute name='maximumactivebusinessprocessflowsallowedperentity' />
               <order attribute='name' descending='false' />
              </entity>
              </fetch>";

                EntityCollection organizationColl = service.RetrieveMultiple(new FetchExpression(fetch));

                if (organizationColle != null && organizationColl.Entities.Count > 0)
                { 
                //update maximum activate business process flow allowed per entity field.             
                organizationColl.Entities[0]["maximumactivebusinessprocessflowsallowedperentity"] = 11;

                    //update record
                    service.Update(organizationColl.Entities[0]);

                }

 Conclusion:

Though this count can now be controlled through Organization entity, it is advisable to think about alternate methods to streamline the process and restrict the need to create a new process for every change in the business methods. And just to explicitly clarify this works for both CRM Online and On-Premises Deployment.

Resources:

For more details on BPF and the counts for Entities, Stages, and Steps allowed in BPF, please refer to the article below

Business Process Flows on MSDNhttps://msdn.microsoft.com/en-us/library/dn481586.aspx

Export and Email Dynamics 365 Reports in PDF, Word & Excel format with Click2Export