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
cloud47cloud47 

Inserting a previous record value into a new record

Hi, I'm an SA wanting to ascertain if I can specify the following trigger requirement.

Can you do a trigger to insert a value from a previously created record and insert it to a new record?

My scenario is a custom Forecast object, when creating a new forecast record, I want to update a field (9 Month forecast) with the 'Month 9' value of the Forecast record()-3.
Best Answer chosen by cloud47
R Z KhanR Z Khan
Hi,

write a trigger that runs before insert. In the trigger you can query the records that match your conditiona dn then update the value of the '9 Month' field.