web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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,985 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 165

#2
ManoVerse Profile Picture

ManoVerse 161 Super User 2026 Season 1

#3
Zhilan Profile Picture

Zhilan 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans