> ## Documentation Index
> Fetch the complete documentation index at: https://support.fieldko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Control What Syncs to the App

> Learn which objects, fields, and records sync to each rep's device, and how to change them.

The FieldKo Atlas app downloads part of your org to each rep's device so reps can work offline. This page has 2 parts:

* [**How FieldKo Chooses What Syncs**](#how-fieldko-chooses-what-syncs) explains which objects, fields, and records each rep gets. Read it when a rep is missing data.
* [**Change What Syncs**](#change-what-syncs) has the steps to narrow records, add an object, run the Metadata Collector, and choose the layout reps see.

New to sync? See [Key Concepts](/getting-started/key-concepts).

| To do this | You need |
| - | - |
| Run the Metadata Collector | FieldKo Manager Permission Set and FieldKo Native Permission Set |

## How FieldKo Chooses What Syncs

This part explains the rules. To change them, go to [Change What Syncs](#change-what-syncs).

<Info>
  Salesforce sharing always applies. FieldKo then narrows what each rep receives with its own rules, so reps don't get everything they can see in Salesforce.
</Info>

### Which Objects Sync

The app syncs the objects that have an **Object Metadata** record. The **Metadata Collector** creates these records from:

* The FieldKo objects (accounts, contacts, visits, tasks, survey answers, orders, price books, products, ranging, contracts, incidents, and others)
* Every object listed in the **Objects To be Fetched** custom setting
* Parent objects referenced by lookup fields on your page layouts, and child objects shown in related lists

FieldKo leaves out every object listed in **Objects To Exclude**.

You can sync custom objects and these standard objects: Account, Contact, Note, Event, Case, Asset, Task, and Opportunity. Other standard objects can't sync, even if you add them to **Objects To be Fetched**.

### Which Fields Sync

For each object, the app gets every field that appears on **any** of its page layouts. It also gets:

* Every field on FieldKo package objects
* Every custom field, and the address and owner fields, on Account
* Record type, last modified date, and a few system fields on every object

Fields that a rep can't read through field-level security are always left out.

<Tip>
  To make a field available in the app, add it to a page layout for that object, give reps field-level access, and rerun the Metadata Collector.
</Tip>

### Which Records Sync

FieldKo decides which records each rep gets from 2 things: the rep's accounts and a date window.

#### Accounts in Scope

By default, a rep receives the accounts they **own** or where they're on the **account team**. Records that a rep can see only through the role hierarchy or sharing rules don't sync.

If **User Reporting Hierarchy** is set to **Public Group** (on the **FieldKo Configuration** tab, under **Basic**; stored in the **User Hierarchy Base** custom setting), accounts come from account sharing to the public groups the rep belongs to instead. These accounts are limited to the record types selected on the **FieldKo Configuration** tab, under **Basic**.

#### The Date Window and Call Cycles

Visits, tasks, survey answers, orders, ranging, notes, and Next Visit To Do's sync only within a date window:

* **From:** The first day of the previous month
* **To:** The end of the rep's active call cycle, or the end of next month, whichever is later

<Warning>
  If a rep has no active call cycle that covers today, none of these records sync. No error appears, and the rep sees no visits. Check this first when a rep says their visits are missing. See [Call Cycles](/admin/call-cycles-and-visits#call-cycles).
</Warning>

#### Rules for Each Object

| Records | Sync When |
| - | - |
| Accounts | The account is in scope, as described in [Accounts in Scope](#accounts-in-scope) |
| Contacts, account team members | The account is in scope |
| Call cycles | The rep is the sales representative |
| Visits | Planned within the date window, the rep is the sales representative, and the account is in scope |
| Tasks and survey answers | The visit is in the date window and belongs to the rep, or the account is in scope |
| Orders and order lines | The account is in scope and the PO date is in the date window |
| Ranging | The account is in scope, and: if **Fetch Only Current Ranging** is on, it's the account's current ranging; if it's off, the ranging was created in the date window |
| Ranging contracts, FieldKo contracts | The account is in scope |
| Product sets | Used by a ranging contract on an in-scope account |
| Price books and entries | Linked to an in-scope account through a FieldKo contract, active, and for active products |
| Digital sales aids | Today is between the start and end dates |
| Events | Owned by the rep and in the date window |
| Your own objects with a lookup to Account or Visit | The account (or the visit's account) is in scope |
| Any other object | **Every record the rep can see**, subject to sharing |

To narrow the records of a specific object, see [Narrow Records with Duration of the Data to Be Fetched](#narrow-records-with-duration-of-the-data-to-be-fetched).

#### Records That Leave a Rep's Scope

When a record is deleted in Salesforce, the app removes it from devices at the next sync, while the record is still in the Recycle Bin.

Records that move out of a rep's scope, for example when an account is reassigned, stay on the device until the rep runs [Reset Sync](/sync/reset-sync).

#### How Many Records per Request

Sync fetches records in pages. **Number of Records** in the **Sync Configurations** custom setting sets the page size. It's 999 after install.

### Conflicts

If a rep edits a record offline and the same record changes in Salesforce before the rep syncs, the result depends on the object:

* **Objects with a Last Modified (FieldKo) field** (visits, tasks, survey answers, orders, ranging, notes, incidents, pack-outs, accounts, and contacts): If the Salesforce version is newer, FieldKo keeps it and doesn't apply the rep's change.
* **Other objects:** The rep's change overwrites the fields they edited.

## Change What Syncs

This part has the steps to change what reps get. For the rules these steps change, see [How FieldKo Chooses What Syncs](#how-fieldko-chooses-what-syncs).

### Narrow Records with Duration of the Data to Be Fetched

To control which records of an object sync, add a record to the **Duration of the data to be fetched** custom setting:

1. From Setup, in the Quick Find box, enter `Custom Settings`, and then select **Custom Settings**.
2. Next to **Duration of the data to be fetched**, click **Manage**.
3. Click **New**.
4. In **Name**, enter the object's API name. Find it in Setup > Object Manager.
5. Set the fields in the following table.
6. Save your changes.

| Field | Effect |
| - | - |
| **Number Of Months** | How many months back to fetch (default 1) |
| **Filter by DateTime Field** | The date or date/time field for the window. FieldKo uses Created Date if no other filter is set. |
| **Filter by User** | A user lookup field that must equal the rep |
| **Filter by Boolean Field** | A checkbox (or formula) field that must be true |
| **Filter by Account Field** | An account lookup whose account must be in scope |
| **Apply FieldKo Filters** | When on, these filters apply as well as FieldKo's built-in rule. When off, they replace it. |

Objects listed here also follow the call cycle requirement in [The Date Window and Call Cycles](#the-date-window-and-call-cycles).

### Add an Object to the App

Use these steps to make one of your own objects, or a supported standard object, available offline in the app:

<Steps>
  <Step title="Check That the Object Can Sync">
    It must be a custom object, or Account, Contact, Note, Event, Case, Asset, Task, or Opportunity.
  </Step>

  <Step title="Add It to Objects To Be Fetched">
    From Setup, in the Quick Find box, enter `Custom Settings`, and then select **Custom Settings**. Next to **Objects To be Fetched**, click **Manage**, and then click **New**.

    Fill in the record, and then save your changes:

    * **Name:** Enter the object's API name. Find it in Setup > Object Manager. If it's longer than 40 characters, enter it in **Object Name** instead.
    * **Upsertion Order Value:** Enter a number greater than 50.
    * **Show In Menu:** Select this to show the object in the app's side menu.
    * Optional: Set **Menu Label Override** and **List View Fields**.
  </Step>

  <Step title="Make Sure It Isn't Excluded">
    Check that the object isn't listed in **Objects To Exclude**.
  </Step>

  <Step title="Prepare Layouts and Access">
    Put the fields reps need on a page layout. Give reps object and field-level access.
  </Step>

  <Step title="Decide Which Records Sync">
    Check which records reps get under [Rules for Each Object](#rules-for-each-object).

    Optional: To narrow the records, add a **Duration of the data to be fetched** record. See [Narrow Records with Duration of the Data to Be Fetched](#narrow-records-with-duration-of-the-data-to-be-fetched).
  </Step>

  <Step title="Run the Metadata Collector">
    See [Run the Metadata Collector](#run-the-metadata-collector).
  </Step>

  <Step title="Ask Reps to Reset Sync">
    Ask reps to run **Reset Sync**. The object appears after they reset.
  </Step>
</Steps>

### Run the Metadata Collector

The Metadata Collector reads your objects, fields, layouts, record types, and profile layout assignments, and stores them for the app. Run it after you install FieldKo, and every time you change any of these.

<Check>
  Before you begin, make sure you have the FieldKo Native Permission Set and a [remote site setting](/admin/installation#remote-site-settings) for your FieldKo Native Visualforce domain.
</Check>

#### Collect Metadata

Collecting objects and layouts replaces all previously collected metadata. Run both collectors, and then ask reps to reset:

1. From the App Launcher, find and select **Metadata Collector**.
2. Click **Collect Objects and Layouts Metadata**. Wait for "Objects and Layouts Metadata stored successfully."
3. Click **Collect Profiles Metadata**. Wait for "Profiles Metadata stored successfully".
4. Ask reps to tap **Sync**, and then run [Reset Sync](/sync/reset-sync).
   * Syncing first uploads their unsynced changes so they aren't lost.

#### Metadata Collector Messages

| Message | What to Do |
| - | - |
| Error while querying through Tooling API | Add the remote site setting for your FieldKo Native Visualforce domain. |
| Access Denied: Insufficient Privileges | Assign yourself the FieldKo Native Permission Set. |
| Reps see "No profile metadata found. Please contact to you administrator to generate it." | Click **Collect Profiles Metadata**. Check that the rep's profile isn't in **Profiles To Exclude**, and that it's in **Profiles To be Fetched** if you use that list. |

#### Limit Which Profiles Are Collected

These are list custom settings. From Setup, in the Quick Find box, enter `Custom Settings`, select **Custom Settings**, and then click **Manage** next to the setting. Add one record per profile, with the profile name in **Name**.

| Setting | Effect |
| - | - |
| **Profiles To be Fetched** | Collect layouts only for these profiles. Leave it empty to collect all profiles. |
| **Profiles To Exclude** | Never collect these profiles. **Chatter Only User** is excluded after install. |

#### Skip Related-List Objects

By default, the Metadata Collector also adds the child objects shown in your page layouts' related lists. To stop this, in the **Metadata Configurations** custom setting, select **Skip Child Objects Metadata** on the `Metadata Configuration` record.

### Choose the Layout Reps See

The app uses the page layout assigned to each rep's profile and record type. To use a different layout in the app, add a **FieldKo Layout Override** custom metadata record. See [Page Layouts](/admin/configuration-reference#page-layouts).

## See Also

* [FieldKo for Admins](/admin/overview)
* [Install and Set Up FieldKo](/admin/installation)
* [Configuration Reference](/admin/configuration-reference)
* [Reset Your Offline Data](/sync/reset-sync)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.