Hi dear reader,
Thanks for reading my challenge.
We’re discussing a CRM 2016 on premise installation.
To keep things simple, I’m using an simplified example.
My entity has two custom fields: A and B. Both fields are of the data type “Two options”. Both included in the main form.
There is a plugin running along saying: if A is checked OnSave, the record cannot be changed afterwards anymore. I can not disable this plugin.
I would like to create a Business Rule that says: as soon as A is checked, B should be checked also! I want the scope to be Entity because I want it to run without using a form of any kind.
And, so I did (wasn’t too complicated).
Now, when I use advanced find to list the records of this entity, I select a few and use bulk update to have field A checked. In the database I see that the Business Rule hasn’t done anything, which I could understand due to the plugin. So, A=1 and B=0.
But! When I open the form of one of the changed records, both A and B are checked. Obviously B is checked OnLoad (I see the 'unsafed data' notification on the bottom right), but still: how is that possible if there’s a padlock on áll fields (because of the plugin)?
I still get the feeling that the Business Rule can overrule the read-only state of the fields, but not all behaviour substantiates that.
Am I fighting windmills here? Is this only to be done using another plugin (or changing the running one)? Any other ideas?
(obviously, an asynchronous workflow that checks B when A is checked, fails because the field cannot be changed anymore)
Again, thanks for reading and thinking along with me!
Best regards,
Jeroen
*This post is locked for comments
Amázing! First shot = bullseye!!
(and, I would never have found this out myself.. knowing a bit too little about plugins)
Thank you very much, Somesh! You made my day!
Best regards,
Jeroen
Hi Jeroen
Business rules with entity scope run synchronously and should execute before the Plugin code.
The only scenario where I think it would not work is that your Plugin is registered on "pre-operation" or "pre-validation".
If your Plugin is on post-operation, your business rule should work. Can you please check if this is the case.
This is what I think is causing the issue according to me.
Please mark this as answer if it resolves your query.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156