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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Auto generated child record when creating parent line

(0) ShareShare
ReportReport
Posted on by 275

Hi

I have a created an alteration to SalesProjectQuotationLine (Parent) by creating an extra table (Child) which contains alot of extra infomation. 

But the line should only be created if the Parent type is a specific type. The problem is because of the innerjoin on the datasource level, the line are created automatically. I have tried to alter Write (Form method), ValidateWrite (Form method), InitValue (Form method), OnCreating (Form event method), OnInitValue (Form event method), OnValidatingWrite (Form event method), Insert (Table method), Update (Table method), InitValue(Table method) But none of the methods are called before the line are created.

How can i prevent the Parent inserting a new record on the child? Or atleast creating my if before the line are created.

Sinceryly AShein

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    skip super() in write if you dont wont to save it and then return true from validateWrite to avoid warnings.

  • Verified answer
    Martin Dráb Profile Picture
    239,519 Most Valuable Professional on at

    An inner join sounds like a bad choice if the related record will exist only for certain header. The inner join would filter out all headers that don't have that, i.e. all header except of those of your specific type.

    Consider using a link (such as Delayed) instead of a join, or using an outer join. Then you can create the line from code (or, in case of outer join, let the system to create a line automatically when one of its fields get changed).

  • Ashein Profile Picture
    275 on at

    Thanks Martin, this worked exactly the way i should.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 660

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 655 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans