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, ...
Answered

Delete header and line

(0) ShareShare
ReportReport
Posted on by 1,215

Hi all,

if i delete header line also I want to delete.

but, in my custom form if i delete header does not delete line.

so that what should i write in validate write method ? give me example for that?

Thanks 

I have the same question (0)
  • Riyas ahamed F Profile Picture
    1,215 on at

    Correction : validate delete

  • Verified answer
    Martin Dráb Profile Picture
    237,912 Most Valuable Professional on at

    If you wanted to write your code (which you shouldn't), you would do it in delete().

    validate* methods are just for validation (and the method used for validation before deletion is validateDelete()).

    The right approach is defining a relation on the line table and setting On Delete property to Cascade.

  • Riyas ahamed F Profile Picture
    1,215 on at

    Thanks for replay sir,

    i don't want delete action i want to via x++.

  • Verified answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi Riyas,

    delete actions in table relations are the correct way to handle this. I strongly recommend you to use them - this also helps you and future developers understand and work with your solution, since it uses the common and understandable design principles.

    Technically you can of course also write code in the delete() method of the parent table, and delete child lines. 

    You should never put this kind of logic in validate* methods, they are intended for validation only! 

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 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans