Notifications
Announcements
No record found.
Hi ,
I have created the business rule and my requirement is that the business rule should be executed only on form load.
*This post is locked for comments
Hi Dynamics User,
I do not think it is possible to have a Business Rule that executes only on form load. However, you can create a JavaScript file that mimics the behaviour of your intended Business Rule, and have that run only on form load.
Hi,
Business rules can run when a form is loaded or when a field value changes (causing the condition to be evaluated).
As suggested by Adrian Begovich, you can register an on-load Javascript function in the Form Properties in the Form Editoe inorder to exclusively run the logic on form-load.
Hope this helps.
Ok I this case business rule is not useful and I need to achieve this via JavaScript.
Also one more point. Can I call business rule from workflow and workflow is only executed when form loads?
No, you can't call a business rule from a workflow. The workflow executes only on the triggers provided (like Record creation, updation, deletion, assignment, status change etc.). Workflows can run synchronously or asynchronously. Business rules are more or less same as sync workflows.
See: http://gonzaloruizcrm.blogspot.com/2016/08/business-rules-vs-sync-workflows-in-crm.html
Just for the information i have achieved the required behaviour by adding javascript function on form load. To check whether it is create or update form i have used Xrm.Page.ui.getFormType() . This way my javascript is executed only on new and not on update.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2