Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Updating Parent Record on delete of editable Sub-grid record

(0) ShareShare
ReportReport
Posted on by 18

I have a parent record (budget) that I need to have a live update on the total of the child records (budget items). Each time the a Budget Item is updated/added/removed, I need to the parent records to update the total. This needs to be done on the parent (budget) form in real time with the budget items being in an editably sub-grid.

I tried the following code

var gridContext = formContext.getControl('EditableSubGridName');//Verify the subgrid is loaded, if not recursively call function againif (gridContext != null && gridContext != undefined) {    gridContext.addOnLoad(CalculateTotal);}

The above only gets called on a Save, it is not triggered on a deletion of a sub-grid record.

  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Updating Parent Record on delete of editable Sub-grid record
    Hi Partner,
    Sometimes sub-grid take more time to load onto the form than other controls, try adding the setTimeout() function to ensure that if your javascript code is executed before the control is available, we will wait and then try to attach the event to the control again.
    Please refer to the following links for more details:
    Make sure that add the CalculateTotal function that you used in addonLoad() to the subgrid OnLoad event.

    I hope you can verify my answer if it helps you! If you have any questions, please feel free to contact me.
    Regards,
    Leah

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,605 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans