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
Adam LeeAdam Lee 

Creating a trigger to update the parent record type based on a field on the latest child record

Hi All,

I am trying to create a trigger to update the record type on the parent based on a field on the latest child record and struggling to do so.

Has anyone done anything like this before?

Hope you can help.

thanks
Adam LeeAdam Lee
Oh and I know I can do this using workflow rules but I have 15 record types on the parent and I dont want to create 15 workflow rules.

thanks
Cloud_forceCloud_force
A trigger code will do your requirememt. Just get the id of the parent record and query on the parent object and then update its recordtypeid.

thanks,
http://www.forcexplore.com