Posts

Showing posts from July, 2020

DYNAMICS 365 HOW TO COPY PASTE BUSINESS RULES COMPONENTS

Image
Last day, I was working with Business Rules and one of them was quite large and contains many conditions and actions. To speed up my creation of this business rule, I used the Copy/Paste components in Business Rules that exists out-of-the-box. So I decided to write a post about it and share my thoughts. For the sake of this post, I will create a new business rule against the Account entity. This business rule will show/hide fields and make them required based on the Relation Type field. Therefore, similar conditions and actions will exist in order to achieve this requirement. Let's start by setting the initial condition Next, in the right pane, Drag/Drop the components Set Visibility and Set Business Required to the True part of the condition and set t...

DYNAMICS 365 HOW TO CHECK IF BUSINESS PROCESS FLOW (BPF) EXISTS ON A RECORD

Working with Business Process Flows is very popular and requested for many scenarios. But it is sometimes tricky especially when you have some treatment to do in JavaScript. Some of these scenarios might be changing the BPF phase if a field is set to a specific value or show/hide fields/tabs based on the BPF phase ... that require some JavaScript code in order to achieve them. For some developers, it is straight forward to capture the process stage by entering the following lines of code. var stage = formContext.data.process.getActiveStage(); var stageName = stage.getName(); if (stageName == "<somevalue>") { //Do something } This is enough and will perfectly work for new records, since the BPF will be automatically assigned to the record. However, for old records that exist before...