Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Disabling Subgrid autosaving

(1) ShareShare
ReportReport
Posted on by

I have a subgrid looks up records to add to the grid itself. The records being added might be an invalid record. I use the onload event handler to figure out whether the record being added is valid or not. If its invalid the goal is to set up an error message to indicate that the record is invalid and not to save. When I add a new record the sub grid automatically saves regardless if the added record is correct or not. I tried adding the prevent auto save function into the form.

function preventAutoSave(econtext){ 
var eventArgs = econtext.getEventArgs(); if (eventArgs.getSaveMode() == 70 || eventArgs.getSaveMode() == 2) { eventArgs.preventDefault(); } }


 It still doesn't stop the subgrid from autosaving its results. Since I can't create a view without invalid records the only option was to check if the record is invalid as it is added in. Is there a way to disable the subgrid autosaving

*This post is locked for comments

  • RE: Disabling Subgrid autosaving

    I might just resort to adding the record and then dissociating the record from the table

  • RE: Disabling Subgrid autosaving

    It is a n:n relationship I was trying to avoid creating a plugin if possible, but I'll look into the doing the association dissociation using javascipt

  • ScottDurow Profile Picture
    ScottDurow 19 on at
    RE: Disabling Subgrid autosaving

    I think it would be best to validate the data as it is entered rather than prevent save.

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,267 on at
    RE: Disabling Subgrid autosaving

    What kind of relationship is it? 1:n or n:n?

    Depending on the relationship type you could develop a plugin that does your check and skips the addition/association of records if your requirements are not fulfilled.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans