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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

update child datasource from parent datasource

(0) ShareShare
ReportReport
Posted on by 672
Hi Folks,
 
I want to update a value in a field in one of the child datasource when some fields are updated in primary datasource.
 
So in which method should I write the logic for updating a field of child datasource. As if I write code in active() method of Primary then it will call everytime unnecessary.
 
 
Thanks in Advance!!!
 
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    240,534 Most Valuable Professional on at
    active() it's called when you select a record in a form, not when a record is being saved.
     
    update() method of the table is usually the best place. If the logic is specific to this single form and it should apply anywhere else, use write() method of the form data source.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,214 Super User 2026 Season 2 on at
     
    You can add your logic to the Write method of primary Datasource, but I prefer to add it on the modified field (when some fields are updated in primary datasource) of the fields that you want.
     
     
     
    Thanks,
    Waed Ayyad
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     
  • Martin Dráb Profile Picture
    240,534 Most Valuable Professional on at
    Note that saving other tables in modifiedField() would be a bug causing data inconsistency. That's because it would update related records before the primary is actually saved, and it may never be saved at all (because a validation fails, a user decides aborting the change, there is a failure and so on).
  • D365FO Avatar Profile Picture
    672 on at
    Thanks Martin, 
     
    After using write() method of the primary datasource. It worked as required and in last I have update the Datasource with refresh and research methods.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 341 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 312

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 262 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans