Use Process builder to write over some fields from opportunity to Account (person Account) - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Hans-Georg GruberHans-Georg Gruber 

Use Process builder to write over some fields from opportunity to Account (person Account)

Hello,
i would like to write over some data like stage etc from opportunity to the connected Person Account (meaning the account object). 
What is the simplest way to do this?
I am thinking of the following solutions:
1) Using a cross object formula -- not sure how this works with existing objects
2) using a process to write the fields over - but in the process I did not find a way to carry over the field value. 
3) use process and flow with a variable to carry over the value. Might work but isnt there a simpler solution?
Thanks!
Hans-Georg
Best Answer chosen by Hans-Georg Gruber
Jonathan FoxJonathan Fox
Simplest way would be to create a brocess using process builder for the object Opportunity on create or update.

Criteria would be Text field is not Null

Action, update field, record related to the record which started the process. And then choose your account field.

All Answers

Jonathan FoxJonathan Fox
Hi there!

I can help you with this but first of all, what would you want happen in a situation whereby an account may have 2 opportunities?
Hans-Georg GruberHans-Georg Gruber
we dont have that situation
Hans-Georg GruberHans-Georg Gruber
I have to add that when trying to generate a cross object formula, I cannot see the object -- there is not Field where I can switch to the object -- maybe because one account could have more than one opps? - confused...
Jonathan FoxJonathan Fox
I understand you may not intentionally but the relationship of Account and Opportunity is a Many-to-One Opportunity-To-Account. Thererfore it will complicate your process using standard lookups on those objects. If someone accidently related a second opportunity to an account, it could cause unexpected behaviour in your automation.

I would suggest lookin at your lightning record page as you can dsiplay related records next to the record details quite easily which could show you the information needed all in one view with no automation.
Manasa UdupiManasa Udupi
Hi Hans-Georg,

Yes, a Formula field will not work here, since an Account could have multiple Opportunities.

You need to create a Process Builder on the Opportunity that is triggered when an Opportunity is created or updated and update the Account fields.
Jonathan FoxJonathan Fox
Manasa is correct.

Also, the suggested method would work, however, as I mentioned, if you accidently add/create/update a new opportunity, you could end up overwriting the data on the account.
Manasa UdupiManasa Udupi
Also, Process builder will not be triggered on the historical data. If you need this data on old Accounts whose Opportunities will never be updated, then you could create a hidden field on the Opportunity, that is not displayed on any of the page layouts and use data loader to update this field.

Modify the Process Builder criteria to include Ischanged(HiddenField) as an OR with other criteria.
Hans-Georg GruberHans-Georg Gruber
@Thanks Jonathan, Manasa, so this is why I was trying out some processes. 
But the obstacle I cannot overcome is that I need to bring over the value from the opportunity to the account. So how can this be done / what is the trick here?  I know that with flows I can input variables into the flow - but I would like to have the simplest possible structure. So e.g. there is some text in a field in the Opportunity - I would like to bring that text over to the account - how would I do that? Thanks
 
Jonathan FoxJonathan Fox
Simplest way would be to create a brocess using process builder for the object Opportunity on create or update.

Criteria would be Text field is not Null

Action, update field, record related to the record which started the process. And then choose your account field.
This was selected as the best answer
Hans-Georg GruberHans-Georg Gruber
@Jonathan, Manasa - thanks for helping me out!! Now I found it -- I was missing the type "field reference" int the action of the process -- hope it works -- understand that it only works for the changes from now on-- need to test now.... :-)
thank you so much for the support!! 
Very happy :-)


process type field reference
Jonathan FoxJonathan Fox
Not to worry. You are more than welcome. That is what we are here to do, help each other!

If you could mark a best answer so that your question is solved but do not hesitate to reach out to us or post another question!

Have a great weekend and stay safe.
Manasa UdupiManasa Udupi
After creating a text field on the Account to copy over the Opportunity Text field value, create a Process builder as below:

1. Setup → Process Builder → New → Provide Name → The process starts when* – A record Changes → Save
2. Add Object → Opportunity → When a record is created or edited → Save
3. Add Criteria → Provide Criteria Name → Conditions are met → Enter the below three Criteria :
[Opportunity].Textfield__c Is changed Boolean True

Select All of the conditions are met (AND) → Save

4. Add Action → Update Records→ Enter action name → Under Record Type →  'Select a record related to the Opportunity' → Choose Account

5. Under Criteria to update records, choose No criteria—just update the records!

6. Under Set new field values for the records you update, select below:

Account_Text_Field               Field Reference                 [Opportunity].Text_field

7. Save and Activate the Process Builder.