function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

controller class action




Currently I have Custom controller that will select the Product services and insert OLI into relevant Opportunity. And OLI is creating revenue schedule if there is any.(via trigger after insert)



I have validation rule (under OLI) in place that check: AND(Hasrevenueschedule, Ischanged(unitprice))


How can i insert the child record(OLI schedule) after parent(OLI) has been saved. Can i use same controller class to insert child record? so i can avoid validation to execute.




I'm not certain I understand exactly, but if you're trying to use a trigger to create a parent and child record at the same time, I had this issue a month or so ago.  The contributer who solved my question broke down the solution very clearly, so here's the link:


Hopefully that helps!