Problem: You want to link an Account with its ultimate parent Account.
When you have multi-level account hierarchies, there are often many benefits to having all child accounts directly related to the top level account. For example, it can make it easier to pass information down from the top level parent, or to aggregate information up to that level without having to traverse multiple relationships.
Solution: The first step of this setting is to create a formula field on Account, which will return the id of the top level account from the Account Hierarchy.
The name of this field can be Ultimate Parent Formula LH. Here's a sample of this formula:
CASESAFEID(BLANKVALUE(Parent.Parent.Parent.Parent.Parent.Parent.Id,
BLANKVALUE(Parent.Parent.Parent.Parent.Parent.Id,
BLANKVALUE(Parent.Parent.Parent.Parent.Id,
BLANKVALUE(Parent.Parent.Parent.Id,
BLANKVALUE(Parent.Parent.Id,
BLANKVALUE(Parent.Id,
null)))))))
This formula goes up six levels to get the ultimate parent's id, and it can also be modified to go further.
Once the formula is created, you'll need to create the Lookup Field that will be populated by Lookup Helper. This will be a Lookup to the Account Object; it can be named "Ultimate Parent Account."
After this field has been created, you can go into Lookup Helper to create the setting.
- The first choice will be to select the Child Object, which in this case is "Account"
- Then select the Ultimate Parent Account Lookup Field we created earlier
- On the next page, select the Ultimate Parent Formula LH as the matching field on the Child Object
- Then select Account ID as the matching field on the Parent Level
- Once you have made these selections, just save and run the setting