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
shobana Ganesanshobana Ganesan 

Is it possible to change stabdard account owner field (createdbyId) with the lookup field.

We have a custom object "cust_obj__c" & account object where both are in lookup.  The requirement is to replace the standard account owner field with the lookup field(cust_obj__c) where process builder & workflow doesn't suits our scenario.
Fyi,
When ever the cust_obj__c has been updated with 'xyz', parallely the account owner field should be updated as 'xyz'.
 
Kindly help me out on this issue.
 
Thanks,
Shobana.G
 
NagendraNagendra (Salesforce Developers) 
Hi Ganesan,


The CreatedBy is a lookup to User who created the Account. But in triggers, you won't get the lookup fields except for its id.

So you need to query the fields(ProfileId) from CreatedBy in your trigger and then check it against your id(00eU0000000hmKc).

For more information, I would suggest you please check with below link which has a similar discussion which might help you further. Please let us know if this helps.

Thanks,
Nagendra