Business Process Flow Specific Entities in Microsoft Dynamics 365 - Part 2

Colin Maitland, 26 October 2017

In Microsoft Dynamics 365 for Sales or Service, the first-time activation of a Business Process Flow causes a corresponding Business Process Flow instance specific entity to be created.

In this article, Part 2, I will provide more information about the ‘Lead to Opportunity Sales Process’ entity Relationships, Status and Status Reason, Records and Data

In Part 1 of this article, I used the out-of-the-box ‘Lead to Opportunity Sales Process’ Business Process Flow to describe the properties and fields for a Business Process Flow instance specific entity.

In Part 3 of this article, I will provide some interesting information on the possibility of using Import and Bulk Delete for creating, updating and deleting Business Process Flow instance specific entity records.


Entity Relationship Diagram


The following is an entity relationship diagram showing the relationships between the Lead to Opportunity Sales Process entity and most other related entities.

image

The Lead and Opportunity entities contain the following Unique Identifier fields. These fields provide direct access to the GUID value for the related Process and Active Process Stage. The Process value is updated whenever a Business Process Flow is Started; in other words, the most recently started Business Process Flow. The Process Stage field is updated whenever there is a change of Active Stage; in other words, the most recent Active Stage for any previously started Business Process Flow. Note: It is possible for the Process and the Process Stage to be related to two different Business Process Flows.

 image
e.g.

image

Using Advanced Find, it is only possible to join from Lead or Opportunity to Process Stage and then to Process. It is not possible to join from Lead or Opportunity to Process.

image

image

Status and Status Reason Fields


The Status and Status Reason fields are generic to every Business Process Flow specific entity.


image


The following images and table shows the actions that may be performed against a Business Process Flow and the corresponding Status and Status Reason as the result of these actions being performed.

image

image

image

Records and Data

The following information describe how the records and fields are populated based on various Business Process Flow events.

Start Business Process Flow

When a Business Process Flow is started against a record such as a Lead or an Opportunity:

  • a record is automatically added to the corresponding Business Process Flow instance specific entity.
  • the Lookup field for the first entity referenced by the Business Process Flow is set.
  • the Active Stage Id is set to the Id of the current Active Stage of the Business Process Flow and the Active Stage Started On is set to the current Date and Time.
  • the Status and Status reason are set to Active.

Start Business Process Flow

image

When the Active Stage of a Business Process Flow is advanced to the Next Stage:
  • If the change of Active Stage relates to a change of entity between Stages, e.g. from Lead to Opportunity, then the Lookup field for the entity to be referenced by the Business Process Flow, e.g. Opportunity, is set.
  • the Active Stage Id is set to the Id of the current Active Stage of the Business Process Flow and the Active Stage Started On is set to the current Date and Time.

Start Business Process Flow

image
 
When the Active Stage of a Business Process Flow is returned to the Previous Stage:

  • If the change of Active Stage relates to a change of entity between Stages, e.g. from Opportunity to Lead, then the Lookup field for the entity that was referenced by the Business Process Flow, e.g. Opportunity, is cleared.
  • the Active Stage Id is set to the Id of the current Active Stage of the Business Process Flow and the Active Stage Started On is set to the current Date and Time.

Start Business Process Flow

image
 
When the Business Process Flow is Finished then:

  • Completed On is set to the current Date and Time.
  • Duration is calculated in minutes based on Completed On – Created On.
  • Status and Status Reason are set to Inactive and Finished.

Start Business Process Flow

When the Business Process Flow is Abandoned then:

  • Completed On is set to the current Date and Time.
  • Duration is calculated in minutes based on Completed On – Created On.
  • Status and Status Reason are set to Inactive and Aborted.

Start Business Process Flow

When the Business Process Flow is Reactivated then:

  • Status and Status Reason are set to Active.
  • Completed On and Duration remain set to the values they were set to when the Business Process Flow was Finished or Aborted; i.e. these values are not cleared.

Start Business Process Flow

If a record, such as a Lead or Opportunity is deleted, any related records in the Business Process Flow specific entity are retained. However, when viewing those Business Process Flow specific entity records the Lead Id and Opportunity Id fields would display a value of ‘(No name)’.

image