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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

CRM Online Calculations

(1) ShareShare
ReportReport
Posted on by 16
I have an aold CRM system we are upgrading to CRM Online.
There are a number of calculations carried out by Javascript in the system which we are hoping to replace with Business Rules or Calculated fields. We are finding this difficult to do due to the complexity of the Javascript. 
I have copied in a snippet of the Javascript, would anyone know if it's possible to do this another way other than through Javascript?
 
If (estimate >= appsEst) {
   if (type == "A" && estimate != null && appsEst != null && income != null) {
        if (income <= 37500) {
            grantAmt = appsEstimate * 1.00;
            grantField.setValue(grantAmt > 40000 ? 40000 : grantAmt);
           Per.setValue("1.00");
 }
        else if (income <= 43750) {
            grantAmt = appsEstimate * 0.85;
            grantField.setValue(grantAmt > 34000 ? 34000 : grantAmt);
       Per.setValue("0.85");
}
        else if (income <= 50000) {
            grantAmt = appsEstimate * 0.75;
            grantField.setValue(grantAmt > 30000 ? 30000 : grantAmt);
       Per.setValue("0.75");
 }
}
I have the same question (0)
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,373 Most Valuable Professional on at
    Yes, you can replace this JavaScript logic with a combination of Business Rules and Calculated Fields in Dynamics 365 CRM Online. 

     Solution Breakdown: 
    1. Business Rules – Handle conditional logic (`if-else` checks). 
    2. Calculated Fields – Perform calculations (`grantAmt = appsEst * multiplier`). 
    3. Workflows/Plugins – For complex validations (e.g., `grantAmt > cap ? cap : grantAmt`). 

     Steps to Implement: 
    1. Create a Calculated Field for `grantAmt` (if formula logic is straightforward). 
    2. Use Business Rules to: 
       - Check `type == "A"`, `estimate != null`, etc. 
       - Set `Per` values (`1.00`, `0.85`, etc.) based on `income`. 
    3. For capping logic (`> 40000 ? 40000 : grantAmt`): 
       - Use a real-time workflow or Power Automate flow to enforce limits. 

     Recommendation: 
    - Use Business Rules for most conditions. 
    - Fall back to a Plugin if logic is too complex for no-code solutions. 


     
  • SignInNameNotAvailable Profile Picture
    16 on at
    Hi Muhammed,
     
    Thanks for the reply but not really sure I follow.
    What can I use for Less Than "<" or Greater Than ">" as there does not seem to be any operator for these in either business rules or calculated fields.
     
    Thanks.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans