Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

Calculated Field Auto-Update

Posted on by 50

Hi,

We've got a few calculated fields that we need to update on change of two other fields, Does anyone have any information or suggestions to achieve this such as some JavaScript examples?

Thank You,

  • AidanM Profile Picture
    AidanM 50 on at
    RE: Calculated Field Auto-Update

    Hi Pankaj,

    Perfect, Thank you!

  • Anthony Dong Profile Picture
    Anthony Dong on at
    RE: Calculated Field Auto-Update

    Agreed with Pankaj's suggestions. Verified in my side

  • Verified answer
    Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: Calculated Field Auto-Update

    Hi Aiden,

    You can use the formContext to set the calculated fields. onChange you can trigger the Javascript function. Sample code for reference.

    function SetCalculatedField(executionContext)
    {
        var formContext = executionContext.getFormContext();
        var calculated = field1   field2;
        formContext.getAttribute("calculatedField").setValue(calculated);
    }

    Hope this helps

    Bets Regards

    PG

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans