You need to sign in to do that
Don't have an account?
Srt
I have two objects which are not related to each other, Let them be Object A and Object B.
Hi Devs,
I have two objects which are not related to each other, Let them be Object A and Object B.
When I insert an Object A successfully , I need to update a feild called 'Result' on Object B saying successful.
The code is bulkified and I am using a list to insert Object A, How can I update the records in B saying successful based on the Database.upsertResult(or any otherway) since both the objects are not related???
Thanks in Advance :)
I have two objects which are not related to each other, Let them be Object A and Object B.
When I insert an Object A successfully , I need to update a feild called 'Result' on Object B saying successful.
The code is bulkified and I am using a list to insert Object A, How can I update the records in B saying successful based on the Database.upsertResult(or any otherway) since both the objects are not related???
Thanks in Advance :)
Refer below link for similar discussion.
https://developer.salesforce.com/forums/?id=906F0000000B00qIAC
Best Regards,
Sandhya
There are two ways:
1. Use Process Builder
2. Use Trigger
Hope you can develop the Trigger or set a Process.
Thanks
Vinod
Do you want to update all records of object b to be updated when object A is Inserted?
Trigger on Object A (After Insert)
{
List<ObjectB> lstOfObjectB = [Select result from ObjectB];
if(Trigger.IsInsert())
{
lstOfObjectB.result = 'successful';
}
update lstOfObjectB;
}
Mark my Answer, If it helps you.
Thanks,
Hasan Shamsi