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
London AdminLondon Admin 

copy a record from one object to another when a field changes

copy a record from one object to another when a field changes

I have an object test__c and test2__c

I want to fill in oject test with a field and have it go through an apporval process, once the approval has been completed it will set a field of status__c to approved,

What is the best method (is it using apex?) of taking the approved record from test__c to test2__c once status in test has changed to approved?

Thanks
Ravi Dutt SharmaRavi Dutt Sharma
Create a trigger on Test__c and check when the status field is changed to Active, then create the same record in test2__c
Pavit SiddhuPavit Siddhu
Process builder is the best and easiest option for this requirement.
 
cvuyyurucvuyyuru
Do the test__c and test2__c objects are having the same schema else you may need to do field mappings.
1) Create an Approval Process on Test__c.
2) Once the status on Test__c is changed to Approved, fire a trigger on test__c to perform copying of data from test__c to test2__c.