Announcements
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
Thanks Martin, this worked exactly the way i should.
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).
skip super() in write if you dont wont to save it and then return true from validateWrite to avoid warnings.
André Arnaud de Cal...
294,033
Super User 2025 Season 1
Martin Dráb
232,854
Most Valuable Professional
nmaenpaa
101,158
Moderator