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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

modifying a record in grid is not being saved after clicking the action menu item

(4) ShareShare
ReportReport
Posted on by 1,907
Hi,

I added a new tab in blue in ProjSalesItemReq form
this tab has a grid with a custom table, where the first field in blue is a tick box, once i select this tick box for more than one record as true, then i click on the blue action menu item in blue under 'manage', where it does sth


I have an issue, as you know, when we move between lines in the grid, the record gets saved automatically. So what happens is, the user ticks the first line and moves to the 2nd line and tick it, after that, without clicking save, that user clicks the action menu item, where this action menu item looks for lines that have this tickBox as true.  So when they click the menu item, the code doesn't see that the last line has this tickBox as true. How to fix it?

should i save this line automatically whenever this tickbox is modified?
Categories:
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    236,513 Most Valuable Professional on at
    modifying a record in grid is not being saved after clicking the action menu item
    The usual approach is having the Data Source property of the menu item button set to the data source you want to save (and take the records from) and Save Record property set to Yes.
     
    If you can do that for some reason, you could override clicked() method of the button and save the record before actually calling the menu function.
     
    Saving a record on every modification of the checkbox field is possible, but not optimal. It may save (or try to save) the record in moments not expected by users, e.g. when they don't have all mandatory fields filled in and an attempt to set a value of this field would lead to an error.
  • .. Profile Picture
    1,907 on at
    modifying a record in grid is not being saved after clicking the action menu item
    Hi @Martin Dráb​​​​​​​,

    So this tab in blue, is a form part with a custom table (tableX)

    and this grid field in blue is also in this custom table(tableX)
     
    however, the custom action menu item datasource is salesLine and it has saveRecord and needsRecord as Yes (as this action menu item is added to ProjSalesItemReq form so the datasource is salesLine)

    so how on the clicked method of this action menu item I'm going to save a record in tableX while this tableX doesn't exist in the form ProjSalesItemReq?
  • Martin Dráb Profile Picture
    236,513 Most Valuable Professional on at
    modifying a record in grid is not being saved after clicking the action menu item
    Why did you decide to use a form pattern? You seem to artifially created all your problems by that. Make sure that the benefits are worth it and stop expecting that form will behave the same way as if followed the normal design.
     
    Next time, please give us such crucial information at the beginning.
  • .. Profile Picture
    1,907 on at
    modifying a record in grid is not being saved after clicking the action menu item
    Hi @Martin Dráb​​​​​​​,

    the formpart was made by another developer, definitely there was a reason, plus this tab doesn't appear in all legal entities.
    so assuming this is sth i can't change. How can i fix my issue? is the only way to add code to save this record when modifying the tickBox?
  • Martin Dráb Profile Picture
    236,513 Most Valuable Professional on at
    modifying a record in grid is not being saved after clicking the action menu item
    "this tab doesn't appear in all legal entities" isn't any reason for using a form part, therefore forget about it when considering your next step.
     
    You have two options:
    • Either you'll change the design.
    • Or you'll accept that embedding a form in another form isn't the same thing as having a control in a form and it won't behave the same way. You can save the record when changing the field, but take into accounts the problems I mentioned before. But it's definitely not the only possible way. For example, you could let users to explicitly save the record when they're done with their changes.
  • .. Profile Picture
    1,907 on at
    modifying a record in grid is not being saved after clicking the action menu item
    Hi @Martin Dráb​​​​​​​,

    What reasons would make me embed a new form inside the other like this?
    one reason i can think of is that if maybe this form is used in mulitple forms and we don't want to keep repeating?
     
     
    the option to make the user save won't work because they keep forgetting.

    so it seems my only option is to save the record on modifying. unless i understand what reasons would make us want to create an embedded form to understand the impact of changing the design.
  • .. Profile Picture
    1,907 on at
    modifying a record in grid is not being saved after clicking the action menu item
    Hi @Martin Dráb,

    Can you please check my reply?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,841

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 783 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 490 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans