Automatically Move Stages in BPF using Plugin with Related record field value change in Dataverse

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone welcome to another video in this video I will explain you an automation scenario where the business process flow stage can be moved or activated automatically as per the record status or record field value matching or field value selection okay let's take let's tell you the scenario let's say I have an entity College teacher and there is another Ed college class and there is one is to one relationship between teacher and class I can create a new teacher here by giving a name let's say Ram Rahim this is the teacher name and I want to give a mobile number and save it so once I save it you'll see there is a class subgrid this class display as a subd because this is a child entity I can add two types of classes in this grd for for this teacher so click on new class and Define let's say class one and this is a regular class save and close so I have created a regular class here which is a regular type which is a child record for this teacher I can add another class class two which is a extra class okay so you can think of a scenario for example if you are creating a bookings in your uh uh field service then normally what happens some some task or some uh activities are automatically created of different type right now the important thing is in this scenario there is a requirement that I need to implement a business process flow at the top you can see and whenever I have interact I will interact with a child record with a specific type then accordingly this stage should automatically completed or activated meaning that if I'll update the status of this regular type class for this teacher is completed this regular class stage should be completed automatically I do not need to manually uh proceed uh to interact this stage so let us see now it is pending now I want to activate this Edge completed once it is completed I am expecting the regular class stage in the presidence process flow should be completed so let me see Let me refresh and see what happens you see guys the regular class business process Pro stage is completed and now activated the extra class how this automation is done I will tell you this is through a plugin I have written next the class two now once the class two is also completed by the teacher this stage extra class stage should be also updated and also I'm updating the value as completed this is a column I have taken to store the status of the regular class whether it is completed or not this is a related entity record and this is a field which is available in the parent entity okay so if you connect multiple child entities this will not work now let me complete this one the extra class now once it is completed both are completed so I'm expecting now if I refresh the extra class stage will be automatically completed and move to the last stage so let me refresh you see guys extra stage is completed now the last stage is reached so you understand so this is the requirement whenever I am interacting with a child record the parent record business process flow stages would automatically moved that's the requirement so how it is done I have created the tables first this is the first table teacher and second table class I have created a teacher lookup here to create a relationship uh 1 is to one between teacher and class so this is the lookup I have created because of this lookup uh it creates a 1 is to relationship then I have also created the form to store to display all these uh columns and a subgrid uh associated with a class okay now the important thing is business process flow how the business process flow is designed go to business process flow and see what happens I have added four stages the first stage is connected to the parent entity teacher and a data step is connected to name field then second stage also connected to the same entity parent entity but connected to a field College regular class status whether it is completed or cancelled or something to store so this will this value is updated through plugin only once it is completed this value is updated through plugin so this is how automation works the third one is extra class uh stage where I'm connecting to another field data step called as extra class status and the last one you can do whatever you can connect so once the business process FL is created we have developed a plugin and this plugin will help you to run or automate this stage okay the fundamental concept behind this plugin code is first of all we need to run this plugin on the on the child entity record update message okay this is the update message I I have taken and the entity is HSBC class so whenever the class uh record is updated this is running and once it is running I'm getting here the parent uh information parent entity information also using the teacher entity lookup uh teacher entity object I'm extracting the which parent entity and the child entity I have then I am extracting the type of this child class uh record that is trying to activate or deactivate and next information is first of all we are getting all the active business process flow for that specific entity record our entity record is teacher entity so for that teacher entity what are the all active business process flows are there provided uh in the active business process flow uh we are uh we have specified that to get all the active business process flow and return the first business process flow if your entity has multiple business process flow you have to mention the exact name otherwise if it is only one you have to specify zero that will suff sufficient okay and after the active business process flow is retrieved we have to pass and this is the business process flow name we have to store in the variable so that this variable is used uh to update okay ultimately business process flow is an entity right in background so we are updating the active stage here uh so you can go through this code and if there is any doubt you can let me know uh the uh code and everything is updated in my blog and this is the blog in the ship.com where I have mentioned the step by step uh how it is done and the code also given here okay so you can copy and use it in your scenario so it is just a scenario I'm telling you there might be complex scenarios accordingly you have to uh write your code to manage okay so thank you everyone watching this video see you next time bye [Music] w
Info
Channel: Softchief Learn
Views: 1,289
Rating: undefined out of 5
Keywords: Dynamics, CRM, Dynamics 365, Power Apps, d365, power platform, dynamics 365 tutorials, dynamics crm training, bpf stage automation plugin, how to automatically move bpf stage using plugin, business process flow automation, plugin to move stage of bpf using related entity, bpf move stage plugin related child record
Id: IkyD1Vq35fE
Channel Id: undefined
Length: 8min 9sec (489 seconds)
Published: Mon Oct 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.