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
Leonard Silon 8Leonard Silon 8 

Need to update owner based on another object

I need to know if this is possible with process builder or need it in a trigger.

1. I have a contact object with a field named Territory
2. The territory field is a lookup to the custom object named territory
3. on the territory object it contains a field named "external owner". This is a system entered field that does not look up to the user record

What I need is if the terriroty is manually changed on the contact, then the contact owner name changes to the new owner. How do I look up on the user object to link it to the new owner of the contactss automatically when the territory changes?   
Best Answer chosen by Leonard Silon 8
karthikeyan perumalkarthikeyan perumal
Create a flow for updated record. 
Create input parameter with for Username. 
Update the text with user First name, last name. since its not a lookup filed so like will not be show. 

set the criteria in process builder associate this flow with process builder when the criteria met. 

kinldy refer the link below, 

https://automationchampion.com/tag/launch-flow-from-process-builder/

hope this will help you.
Thansk
karthik
 

All Answers

karthikeyan perumalkarthikeyan perumal
Hello, 

use process builder with flow for assign new Owner insted of writing much code in trigger with Mixed DML operation. while using process builder Mixed DML will take care in built. so gohead with process builder. 

Hopw this will help you. 
Mark it best ANSWER if its clear. 
Thanks
karthik
 
Leonard Silon 8Leonard Silon 8
I worked with process builder before posting this question. How do I change the owner? On the territory custom object the external owner field is a text field and does not look up to the user record
karthikeyan perumalkarthikeyan perumal
Create a flow for updated record. 
Create input parameter with for Username. 
Update the text with user First name, last name. since its not a lookup filed so like will not be show. 

set the criteria in process builder associate this flow with process builder when the criteria met. 

kinldy refer the link below, 

https://automationchampion.com/tag/launch-flow-from-process-builder/

hope this will help you.
Thansk
karthik
 
This was selected as the best answer
Leonard Silon 8Leonard Silon 8
I will go ahead and mark yours as best answer. I am not fluent enough with flows to make this work