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,...
Answered

Calculated fields and onSave Javascript sequence

(0) ShareShare
ReportReport
Posted on by 95

Hi all,

I have an issue about sequence Calculated fields and depend fields that using in onSave even Javascript.

E.g: 

A: Simple Field

B: Simple Field

C: Calculated Field = A + B

D: Simple Field

E: Simple Field

Javascript: OnSave () 

var C = Xrm.Page.getAttribute("C").getValue();

E = C + D

Issue: When I click Save, C always use previous/old value. OnSave event always fire before C is calculated.

Is there anyhow configure Calculated fields are calculate before OnSave event ?

I have the same question (0)
  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    What I understand from various threads is that calculated fields are real-time. However, instead of real-time, these seem to happen upon save and not when the inputs are made available.

    real-time for calculated fields mean after the record is saved and in the same transaction, not when the input fields of the calculated field changes before the saving.

    you can write a javascript that does the same as the calculated field, without knowing exactly what are you doing is difficult to provide a different way

    You can also perform the same operation in plugin code instead of using Javascript.

    See below article for more information.

    www.crmconsultants.co.uk/.../

    If found helpful, Please mark my answer verified.

  • baochau Profile Picture
    95 on at

    Thanks, I will try use JavaScript the same calculated field.

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 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans