Dec 13, 2017

Get Form Type in Business Rules

There is no proper way of identify if form is in CREATE or UPDATE. This seems a big missing piece when it comes to implement field functionalities especially for Form Scopes.

Dynamics 365 (Version 8.2 or earlier)

One passive way of doing that is to check if Create On field contains data.

1) Created On - Not Null - Update
2) Created On - Null - Create

Using Create On is particularly sensible since that field is not set with on Load event even by chance.

Dynamics 365 (Version 9)

Then I realise above solution does't work for Version 9. Then found a way to do it slightly differently.

Instead of Created On, we have select a required field to check value to decide if its created or not.

Suppose we need to lock the Department field of Contact after creation.

1) Set Department field as Read-Only in the form.
2) Now do the Business Rule using one of the Required Fields such as First Name.

No comments:

Post a Comment