> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/quick-start/getting-started/set-up-object-relationships.md).

# Connect S-Docs to your customer records

Configure S-Docs relationships for Salesforce standard and Custom Objects.

Once you have successfully installed S-Docs, the next step is configuring the application to recognize the specific Salesforce objects you plan to use for document generation.

To ensure S-Docs works seamlessly with your desired objects—whether they are standard Salesforce objects or custom ones—you must ensure the proper relational architecture is in place.

### Create a Lookup Field on the SDoc Relationship Object

To associate generated documents with your records, create a lookup field on **SDoc Relationship**. This field links the target object to S-Docs.

S-Docs includes lookup fields for standard objects, including **Account** and **Opportunity**. Check for an existing lookup field before you create one.

If the lookup field does not exist, create it. Custom Objects always require a new field. Some standard objects also require one.

1. Navigate to **Setup** > **Object Manager**.
2. Search for **SDoc Relationship**.
3. Select **SDoc Relationship**.

   ![The SDoc Relationship object selected in Salesforce Object Manager](https://1474071652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv7v0UNK83URKB2C83QVU%2Fuploads%2FJffsdutPFHtbfyw9ZTHP%2Fimage.png?alt=media\&token=798c97df-c04d-4a58-8525-6ac9c6b2d208)
4. Select **Fields & Relationships**.
5. Select **New**.

   ![The New button on the SDoc Relationship Fields and Relationships page](https://1474071652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv7v0UNK83URKB2C83QVU%2Fuploads%2FkhdMNFl0no96qSi8xhBI%2Fimage.png?alt=media\&token=6335cd3f-c489-4551-b2f0-3d9f77a3d7eb)
6. Select **Lookup Relationship**.
7. Select **Next**.
8. Select the target object from the **Related To** list.
9. Select **Next**.
10. Enter a value in **Field Label**.
11. Enter a value in **Field Name**.

    Enter the exact object name without `__c`. For example, enter `CustomObj` for `CustomObj__c`.
12. Select **Next**.
13. Select the checkbox for each relevant user.
14. Select **Next**.

    ![The field-level security visibility checkbox in Salesforce](https://1474071652-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv7v0UNK83URKB2C83QVU%2Fuploads%2FrNZIUcoefyodEEcY0wId%2Fimage.png?alt=media\&token=87141271-d2d4-4b68-bbae-3bbcb4e95c9f)
15. Leave the default layout settings unchanged.
16. Select **Save**.

{% hint style="info" %}
For AppExchange packages, use `package_u_CustomObj` as the field name for `package__CustomObj__c`. Salesforce does not allow double underscores in the new field name.
{% endhint %}

### Add a Custom Object to the S-Doc Template Picklist

Complete this procedure when you configure S-Docs for a Custom Object. This lets you create S-Docs templates related to that object.

{% hint style="info" %}
This procedure uses `CustomObj__c` as an example. Replace it with your Custom Object API name.
{% endhint %}

1. Navigate to **Setup** > **Object Manager**.
2. Search for **S-Doc Template**.
3. Select **S-Doc Template**.
4. Select **Fields & Relationships**.
5. Search for **Related to Type**.
6. Select **Related to Type**.
7. Scroll to **Values**.
8. Select **New**.
9. Enter the Custom Object API name as a picklist value.
10. Select **Save**.

{% hint style="info" %}
For a Custom Object from an AppExchange managed package, enter the full API name. For example, enter `package__CustomObj__c`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/quick-start/getting-started/set-up-object-relationships.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
