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
Matthew AllenMatthew Allen 

lookup field child update

Hi,

I need help and I am not sure on the best way to do it, or if it's even possible...

My Accounts have a 3 tier hierarchy, lets call it Grand Parent, Parent and Child. I have created a workflow that populates a lookup field on the Child record with the Grand Parent account. Then across numerous objects I have populated a lookup field with the same. This is so when you view the Grand Parent record, you can view all the child records against it on one page, Fantastic!! It works really well up until the point when the Parent may change.... If you were to move the Parent to a different Grand Parent account, becuase all the lookup fields are hard coded and require an edit on them all to change them, they all remain against the old Grand Parent record.

Is there anyway that when the Parent is changed, all the lookup fields in the child records can update to reflect the new Grand Parent?

urgent help needed!

Thanks

Matt
Best Answer chosen by Matthew Allen
Ankit Maheshwari 2Ankit Maheshwari 2
This blog will help you to update child records.
https://automationchampion.com/2015/03/04/getting-started-with-process-builder-part-6-working-with-related-records/

Please let me know if need more ideas.

Thanks
Ankit Maheshwari

All Answers

Ankit Maheshwari 2Ankit Maheshwari 2
Hi Matt,

For this requirement you should not go with the workflow rule. You should use Process builder. In the process builder we will need to create two different criteria. 

In first criteria we will update Grant parent lookup on the same record same as workflow rule.
In second criteria we will update all the child record when parent account will change.

Or you need to write Trigger and class for this requirement.

I would like to suggest you to go with the process builder.

Please let me know if any error occure or need more ideas on this.

Happy to help you!

Thanks
Ankit Maheshwari
Matthew AllenMatthew Allen
Well the work I have done does use Process Builder, I wasn't aware that process builder could do clever things like update all child records, so I will look into that now. Thanks for your help.
Ankit Maheshwari 2Ankit Maheshwari 2
Hi Matt,

Yes,Process builder has the functionality by which you can update all child records.

If you need my help in this so please let me know I will help you to create this process builder for this requirement.

If this information is helpfull for you so please mark it as best answer.

I will always available for your help.

Thanks
Ankit Maheshwari
Matthew AllenMatthew Allen
Would love some help on that please!
Ankit Maheshwari 2Ankit Maheshwari 2
Yes sure, I will help you. 

Please let me know what do you want from me in this requirement. Need to create Process builder or some ideas by which you can create?

Also we can connect through email if you would prefered.

Thanks
Ankit Maheshwari
Ankit Maheshwari 2Ankit Maheshwari 2
This blog will help you to update child records.
https://automationchampion.com/2015/03/04/getting-started-with-process-builder-part-6-working-with-related-records/

Please let me know if need more ideas.

Thanks
Ankit Maheshwari
This was selected as the best answer
Ankit Maheshwari 2Ankit Maheshwari 2
Hi Matt,

Could you please let me know the knowledge article is helpful for you or you need more assistance.

Thanks
Ankit Maheshwari
Matthew AllenMatthew Allen
Looks like it could be very helpful! thank you.
Ankit Maheshwari 2Ankit Maheshwari 2
You are most welcome.

If it will help so please select my answer as best. Also I will always available for you in case of any help.

Thanks
Matthew AllenMatthew Allen
Ok, so I have got this to work using Process builder, but have a few problems....

If an Activity is linked to an Opportunity which is in turn linked to the account, it doesn't take that Activity as a Child record even though it shows on the Account page because it's not directly linked to the Account? any thoughts on how to get round this? It is the same for activity just against a Contact. It shows on the Account page becuase it works out that the Contact is linked to that Account, but it's not directly linked so the workflow misses it.
Ankit Maheshwari 2Ankit Maheshwari 2
Hi Matt,

Thank you so much for your response. I would suggest you to go with the apex code for this requirement. This is deep relationship so we you should use Apex code. There is no other option.

Thanks