25 Oct’17

D365 SalesPut validation on Business Process Flow


CRM business process flow allows users to enter data in steps which makes it simple and don’t required to scroll down all the way to bottom of form. A single business process flow can be divided into small steps to achieve the same and enter the data easily.

But user may have requirement where a person should not move to the next stage. If it is based on the field than there is no problem, user can simply set the field required and get requirement fullfilled.

But what if user should not allow to move to the next stage until a record of related entity is not present. For example, an account should have a phone call or an appointment to move the next stage.

Or in our case an Incident should have few documents attached to it before moving to the next stage.

While moving from Reporting to Insurance stage it should have below listed document. Otherwise it should display an error.


To achieve this requirement, we can write a plugin on the business process flow. But we must understand the structure of the Business process flow.

  • While creating a new business process flow it creates a new entity with the same name.
    • Which holds the related entity name
    • Current stage
    • Record with which it is associated
  • When creating a record with the having business process flow.

    • Name of the business process flow: Incident Business Process
    • Active stage: Reporting
    • Record name: 20171025–ESTDEL55-1

Plugins- Write Code:

We need to write code and need to compare the current stage with previous stage and check if required document is present or not.
Using the above information user can write a plugin and stop the user to move the next stage until required document is provided.

Register Plugin:

Once you have completed the code you need to register the plugin on update of business process entity.
Message Name: update
Entity: cf_incidentbusinessprocess
Filter attribute: activesateid.
Event stage: pre-operation
Register Image: PreIamge

Once you have completed your plugin and registered it. You can simply test it by moving to the next stage without having the required document. You will receive the below error.

Until user not provides the document he will not be able to move to the next stage


You can write a plugin to prevent a user from moving to the next stage.

Written by

Subhash Mahato

Technical Consultant

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more