Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

JavaScript on Calculated Field

Posted on by 145

Hi All,

I was just wondering if you guys knew if it JavaScript would fire when a calculated field is updated in the On Change event? 

I currently have a calculated field that sums up a couple of rollup fields on the opportunity entity and need to use JavaScript to populate the Est. Revenue field so that when they close the opportunity as won the Actual Revenue is auto populated. 

If you can think of a better way to do this please let me know!

Thanks,

Matt

*This post is locked for comments

  • Suggested answer
    Vikesh Profile Picture
    Vikesh 32 on at
    RE: JavaScript on Calculated Field

    Hi.

    Had a similar requirement and have just tested it out myself.

    You can trigger JavaScript onChange of a calculated field.

    You can also reference the calculated field in your JS code for math queries i.e. if the calculated field is greater than 10

  • Matt Falle Profile Picture
    Matt Falle 145 on at
    RE: JavaScript on Calculated Field

    I think I will use a plug in to do it on the save event in that case, thanks.

  • Suggested answer
    Flydancer Profile Picture
    Flydancer 1,332 on at
    RE: JavaScript on Calculated Field
    I was just wondering if you guys knew if it JavaScript would fire when a calculated field is updated in the On Change event? 

    No, it will not because calculated fields do not change on the form, the calculated value is getting retrieved from the server already. But you can attach your JS to the onload event if you need that calculated value.

    Have you tried using business rules for your case?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans