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)

How to look at multiple fields and then do a calculation based on the results...

(0) ShareShare
ReportReport
Posted on by 26

Hello,

I am wondering how I can do the following:

I have an entity that contains a lot of fee type fields (there is 1 fee type field in each of the 8 sections that I have on the form).  When the Fee Types equal the same then populate the Total Administrative Fee field with the Fee amount from each fee section.  Here is an example:

 

When the Color Black Fee Type is Black and fee amount is 10.00, and the Color Blue Fee Type is Black and fee amount is 5.00, then add the Fee Amounts together and put the total in the Total Administrative Fee field. 

 

If there are 5 sections that have the Fee Type filled in and only 3 out of the 5 are the same, then the Total Administrative Fee field wouldn’t add up anything, but would still allow the user to put a value in the field. 

 

All fee types that are filled in must match in order to do the calculation

 

I wasn't sure if I just had to do logic on every scenario possible or if there was an easier way to look for the matches?

 

Thank you.

 

*This post is locked for comments

I have the same question (0)
  • USA80 Profile Picture
    26 on at
    RE: How to look at multiple fields and then do a calculation based on the results...

    How would I start writing this in a javascript?

  • David Jennaway Profile Picture
    14,065 on at
    RE: How to look at multiple fields and then do a calculation based on the results...

    I think you'd need to write code to this - either JavaScript (client-side) or a plugin (server-side). I think the logic you want is to:

    • Iterate through each fee type field
    • If a fee type field is null, then ignore it
    • Check if the fee type field is the same as all non-null previous values. If so, add the fee field, if not, allow a user to enter a value in the Total Administrative Fee field

    As this affects whether the user can enter a value in the Total Administrative Fee field, I'd use JavaScript for this

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
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans