The Candidate Scan Order tab lists the order in which Restore Set Editor rules will be traversed to find candidates to be restored.
Scanning for candidate records is a difficult problem due to direct and indirect circular relationship loops in Salesforce. For those of a graph theory bent, the problem of finding candidate records is a classic NP-Complete graph traversal problem in the same category as “The Traveling Salesman Problem” and finding minimal spanning ring systems in chemistry. Like all problems in this class, the search path is difficult to represent exactly in a linear set of steps. However, the plan displayed by CopyStorm/Restore is an honest representation of the search plan even thought the actual algorithm used by the search is a bit more complex.
There are a few core operations in a candidate scan:
- A “Find Records in Table” step searches for records within the table. In the plan below, the “Find records in Account” is likely running a SQL statement against the Account table.
- A “Scan Related List” step looks for records in a related list based on records selected in another table. In the plan below, step 5 in the plan finds Case records for all previously selected Account records.
- A “Find Records in Table Referenced By” step looks for records in a table based on the value of a reference field in another table. In the plan below, step 10 finds Contact records referenced by the field AccountContactRole.ContactId.