# Candidate Scan Order

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.

![](/files/hWrMorawHUOL2fAbRQc3)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/copystorm-restore/reference/restore-plan-tab/candidate-scan-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
