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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Microsoft Prefres Javascript or Business Rule?

(0) ShareShare
ReportReport
Posted on by 5,514

Hi,All

which one does Microsoft Prefres Javascript or Business Rule?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Kokulan Profile Picture
    18,054 on at
    RE: Microsoft Prefres Javascript or Business Rule?

    Hi

    Business Rule allows you create form logic without writing javascript but it can only do the following

    1. Set field values
    2. Clear field values
    3. Set field requirement levels
    4. Show or hide fields
    5. Enable or disable fields
    6. Validate data and show error messages
    7. Create business recommendations based on business intelligence

    it has the following limitations, 

    1. Any field utilized in the Business Rule must be on the form in order for the Business Rule to run
    2. You can only have up to 10 Else If Statements
    3. You cannot interact with Tabs or Sections
    4. OnChange events are not triggered when Business Rules set a field value
    5. Whole number fields with TimeZone, Duration, or Language format are not supported
    6. Rule definitions are cached in the mobile app

    ledgeviewpartners.com/.../

    If your requirement can be achieved using Business Rule, you can use business rule otherwise you have to use JavaScript. When you create Business Rule, behind the scene CRM generates the java script for you. You dont get to see the java script. 

    And from my experience, if you have business rule with really large number of steps, doing that in JavaScript is better as you can easily change them.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/create-business-rules-recommendations-apply-logic-form

    Microsoft's recommendation is, if your logic fits within the capabilities of Business Rule, stick with Business Rule as it can be changed by anyone, you do not need a JavaScript developer. But if your logic is complicated and goes beyond the capabilities of Business Rule, then JavaScript is the only option.

  • Suggested answer
    sandeepc Profile Picture
    5,514 on at
    RE: Microsoft Prefres Javascript or Business Rule?

    so it means Microsoft recomends both right

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: Microsoft Prefres Javascript or Business Rule?

    Yes that's correct

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Microsoft Prefres Javascript or Business Rule?

    Hi Sandeep ,

    MS introduce business rules as a replacement of JavaScript for few functionality (already shared above ), so that non developer can implement logic without writing code . You can always go for JavaScript instead of business rules when certain limitation comes in your business rules.  You have the client object model to access all form control , so you can always go for javascript but always to use OOB one like business rules, calculated field , roll-up fields  wherever you need as a replacement of JavaScript , which should be your first choice.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans