web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Can we setup a business rule so that it only executed on form load

(0) ShareShare
ReportReport
Posted on by 587

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

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    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.

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    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.

  • SamiraM Profile Picture
    587 on at

    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?

  • Verified answer
    Nithya Gopinath Profile Picture
    17,078 on at

    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

    Hope this helps.

  • Verified answer
    SamiraM Profile Picture
    587 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans