0

We have a custom object which is having a field called A__C and it is a lookup to the user. So, if anyone chooses this lookup field value i.e. user. the standard owner field should automatically be changed to that user.

Could you please help like is it achievable through workflow or formula? In workflow though we need to select only one user which is not the case here.

1

Using formula you cannot modify a field like Owner.

As you pointed out in your question, Workflow field update will change the owner to a specific user which is statically mentioned and cannot be changed dynamically.

So you can write a trigger to achieve this creating before insert, before update trigger.

for(customObject c : Trigger.new) {
    if(c.A__c != NULL)
        c.OwnerId = c.A__c;
}

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.