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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Change header status once the line (grid)gets changed

(0) ShareShare
ReportReport
Posted on by 515

Dear All,

Greetings. Hope all are safe

Sorry if this sounds a common sense question but i m stuck

 I have two customized table(header and line table) in AX 2012

A new form is dveloped where the dataource is the header and line table

I have a button on form which will explicit change the status at line level

Say header mainmachine is TEST001, Status-Open

Line(grid level) will be Test001,submachine1,Status-CLosed

                          Test001.submachine2,status-submitted

When the button  on form is clicked, it will make the status of all line as Closed. I want the header status to be closed too as all the lines asscoiated with header are closed.

I tried but the code don't work, Also putting the code in execute query method of line datasource do not work too.

header-line-community-Ax-2012paint.jpg

I have the same question (0)
  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    If you want it to work only in the form you are on, you can add code to line_ds.update

    if you want this new structure to work in all ax you can add it to table.update.

    If you write to the table, use doUpdate or update_recordSet (with skip data methods) because the update method of the same table will be called (when you update other lines).

    I've seen people writing the update code to validate and validateWrite, but it's open to discussion

    Also, if you do not refresh the data in the form after the update process, you will not be able to see the changes you have made.

    Finally, when you look at the ax standard forms, you cannot see this type of update. There are always exceptions, but for example if you are going to keep the status the same across all relevant records, do you really need line-based status? Or, check if it is possible to move this update process to the table or class.

  • ergun sahin Profile Picture
    8,826 Moderator on at

    I wrote it as above but later realized there was a button . In fact, most of them are still valid, but obviously there is a code to update the record. Why couldn't you update it in that code. How did you get an error.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans