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
Hanumantha Rao 6Hanumantha Rao 6 

Update Highest parent account name in the hierarchy based on insert and update operation

Hi Folks,

I have  a requirement please see the below and suggest me 

I have created a custom field in Account object ,  which is text field name = Grand Parent Account(custom field), it has to update the highest parent Account name in the heirachy.
A->B->C->D-> ------- upto -->S

now i have created Account A user has to select B as parent Account(which is statndard field) now i need to update the highest parent account in the custom field.

please suggest me or if any one achieve the same requirement through trigger pls forward the code to my email id  " hanu.akki@gmail.com "

Thanks in Advance
Hanu
ShashankShashank (Salesforce Developers) 
Do you have a sample code that you tried to write. Please try and let me know if you are specifically stuck somewhere.