Account Hierarchy Maintenance

This maintenance job adds any missing root account fields for hierarchical accounts.

Applies to

All releases

Apex Name

ResolveRootAccountBatchJob

Where to Run This Job

CMT Administration tab

Risks of Running This Job

None

When Not to Run This Job

N/A

When to Run This Job

  • After migrating hierarchical account data to ensure that the migrated data has valid root account IDs.

  • Anytime that you find any root account IDs are missing.

More Information

The Account Hierarchy Maintenance job resolves the root account field for all accounts in the org. It is especially useful if your org has complex account hierarchies and relationships, because during data migration, it is likely that IDs must be resolved in the target org.

The Root Account (vlocity_cmt__RootAccountId__c) field stores the root account ID for each account in the hierarchy. The Root Account field is essential to maintain relationships between accounts. The Account Hierarchy Maintenance job finds any accounts that have a null root account field and then adds the root account ID. The job reports any errors encountered in the job status email it sends to the org administrator.

After running the Account Hierarchy Maintenance job, you can run the below query to validate the data in your org:

  1. Open the Developer Console.

  2. In the Query Editor tab, paste the following SOQL:

    SELECT COUNT() FROM Account WHERE vlocity_cmt__IsRootResolved__c = false AND ParentId != null;
  3. Click Execute.

    If the query returns 0 rows, there are no accounts that need to be updated.

You can run this query to validate that the Account Maintenance Hierarchy job completed successfully:

SELECT COUNT() FROM Account WHERE vlocity_cmt__IsRootResolved__c = false AND ParentId != null;

The query should return zero rows.