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
Lavanya Ponniah 3Lavanya Ponniah 3 

How to update the contract owner as account owner

At one shot how to update the contract owner as same as account owner
Jerome LusinchiJerome Lusinchi
Hi Lavanya,

for this purpose, you can create a trigger on account object that will update related contracts

regards,
Jerome
Sameer Tyagi SFDCSameer Tyagi SFDC

Hi Lavanya, 

There are two Scenrios.
A) Any User Creating Contract under any account (which is not owns by that user) , then Contract owner should be autometically set as its account owner. 
Solution : You need to create trigger on contract to achieve this functionality.

B) If Account owner changed then Its related contracts owners should be autometically transferred as New account owner. 
Solution : You need to create trigger on Account to achieve this functionality.



Thanks & Regards, 
Sameer Tyagi 
http://mirketa.com/
Robert ZentgrafRobert Zentgraf
Hi Lavanya,

perhaps you can create a master-detail-relationship between account and contract. Then it will be changed automatically.

Regards
Robert
(mindforce: mind-force.de)