Activity Forums Salesforce® Discussions Can I update both parent and child records in the same trigger method?

  • Tanu

    August 31, 2016 at 2:24 pm

    You need a few things to update both child + parent records in the same trigger :

    1)parent MUST be inserted before child.
    2)there MUST be a relation between child and parent before you insert them.
    3)some sort of "temporary holder" for the parent ID before it is associated with the child (here he has used external IDs)

    1)create a parent with an external ID.
    2)create a child with same external ID as parent's.
    3)insert the parent FIRST and then the child.

    Try this,i think this may help you.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos