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

# Conversations custom object

> How to create the Treble Conversation object in Salesforce to save the WhatsApp history with rich formatting and images.

In addition to the Task or Event, Treble can save each conversation's history in a Salesforce **custom object** with rich formatting: line breaks, links and images the person sent over WhatsApp.

<Note>
  **It doesn't replace the Task or Event: it adds to them.** If you create this object, each closed conversation generates the usual activity **and also** a record in the custom object.
</Note>

<Info>
  **There's nothing to enable on Treble's side.** The object just needs to exist in your Salesforce org, with the exact name and fields described below. Treble detects it on its own and starts writing to it.

  If the object doesn't exist, Treble keeps working normally and only writes the Task or Event.
</Info>

<Warning>
  The API names must be **exactly** the ones listed here. If you change one, Treble won't be able to write, and you won't see an error in the platform: records simply won't appear.
</Warning>

<div class="hr" />

## What you're going to create

| | API name | Type |
| - | - | - |
| The object | `TrebleWhatsAppConversation__c` | Custom object |
| Relationship to the record | `Contact__c` | Master-detail relationship |
| The transcript | `Messages__c` | Rich text area |

This is done in Salesforce, with an administrator user. It takes about 10 minutes.

<div class="hr" />

## 1. Create the object

<Steps>
  <Step title="Go to Setup">
    Click the gear icon at the top right and choose **Setup**.

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-1.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=cddc709fa10ac418b65a3d92869548c3" alt="Open Setup in Salesforce" width="320" className="mx-auto" data-path="images/salesforce-custom-object-1.png" />
  </Step>

  <Step title="Open the Object Manager">
    Search for "object manager" in the Setup search bar and go to **Object Manager**.

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-2.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=dc3c5ba2d786c6273e774f7866c95a05" alt="Search for Object Manager" className="mx-auto" width="3456" height="370" data-path="images/salesforce-custom-object-2.png" />
  </Step>

  <Step title="Create a custom object">
    Click **Create → Custom Object**.

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-3.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=4d528115a2836813748a8a214a0c7a4a" alt="Create a custom object" className="mx-auto" width="3442" height="528" data-path="images/salesforce-custom-object-3.png" />
  </Step>

  <Step title="Fill in the object definition">
    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-4.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=566cc286e33ef521e6f478dd46b58854" alt="Custom object definition form" className="mx-auto" width="3426" height="1548" data-path="images/salesforce-custom-object-4.png" />

    | Field | Value |
    | - | - |
    | **Label** | `Treble Conversation` |
    | **Plural Label** | `Treble Conversations` |
    | **Object Name** | `TrebleWhatsAppConversation` |
    | **Record Name** | `Treble Conversation Name` (or whatever text you prefer) |
    | **Data Type** | `Text` |

    <Warning>
      The **Object Name** is the one that matters. Salesforce adds `__c` automatically, so the API name ends up as `TrebleWhatsAppConversation__c`. Type it exactly like this, without spaces.
    </Warning>

    Save. When you're done, the **Details** screen should show the correct API name:

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-5.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=0d36502806a60af361a99b546fa74b16" alt="Details of the Treble Conversation object once created" className="mx-auto" width="3456" height="1566" data-path="images/salesforce-custom-object-5.png" />
  </Step>
</Steps>

<div class="hr" />

## 2. Create the relationship to the record

This field is what connects each conversation to the person it belongs to.

<Steps>
  <Step title="Go to Fields & Relationships → New">
    Inside the **Treble Conversation** object, open the **Fields & Relationships** tab and click **New**.
  </Step>

  <Step title="Choose Master-Detail Relationship">
    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-6.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=bf32b43293a067b254968f13bbfaaaf7" alt="Choose the Master-Detail Relationship field type" className="mx-auto" width="3450" height="1740" data-path="images/salesforce-custom-object-6.png" />
  </Step>

  <Step title="Relate it to the person's object">
    In **Related To**, choose the object where your contacts live (usually `Contact`).

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-7.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=ade6661eb71efa2a1657b9e9c771f0da" alt="Choose the related object" className="mx-auto" width="3444" height="1742" data-path="images/salesforce-custom-object-7.png" />
  </Step>

  <Step title="Name the field">
    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-8.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=da861f086bad451b99732abcd1f3ae54" alt="Name the relationship field" className="mx-auto" width="2930" height="1316" data-path="images/salesforce-custom-object-8.png" />

    | Field | Value |
    | - | - |
    | **Field Label** | `Contact` |
    | **Field Name** | `Contact` |
    | **Child Relationship Name** | `TrebleWhatsAppConversations` |
    | **Sharing Setting** | `Read/Write` |

    <Warning>
      The **Field Name** must be exactly `Contact`, because the resulting API name (`Contact__c`) is the one Treble uses when writing.
    </Warning>

    Go through the remaining steps (profile visibility and page layouts) with the default values and save.
  </Step>
</Steps>

<div class="hr" />

## 3. Create the messages field

<Steps>
  <Step title="Fields & Relationships → New → Text Area (Rich)">
    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-9.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=27bc978377bd3bfccd66de1a882fe300" alt="Choose the Text Area (Rich) field type" className="mx-auto" width="3444" height="1742" data-path="images/salesforce-custom-object-9.png" />

    It has to be **Text Area (Rich)**, not *Text Area (Long)*. Rich text is what lets you see the line breaks and images in the conversation.
  </Step>

  <Step title="Fill in the field details">
    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-object-10.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=ae59f83124208cbd70cd60e7537fe700" alt="Messages field details" className="mx-auto" width="2914" height="1172" data-path="images/salesforce-custom-object-10.png" />

    | Field | Value |
    | - | - |
    | **Field Label** | `Messages` |
    | **Field Name** | `Messages` |
    | **Length** | `131072` (the maximum) |
    | **# Visible Lines** | `25` |

    <Tip>
      Use the maximum length. Long conversations can take up quite a bit of space, and a short field would cause the end of the transcript to be lost.
    </Tip>

    Save.
  </Step>
</Steps>

<Check>
  Done. Starting with the next conversation that's closed, you'll see new records in **Treble Conversations**, related to each person's record.
</Check>

<div class="hr" />

## What each record looks like

| Field | What it contains |
| - | - |
| **Name** | The conversation's start date and time, followed by its internal identifier. For example: `2026-10-13 14:22:05 - 8f3c...` |
| **Contact** | The person's record |
| **Messages** | The full transcript, formatted: each message on its own line, with the images the person sent embedded |

<Tip>
  Add the **Treble Conversations** related list to the page layout of your contacts' object. That way the advisor sees all of that person's conversations directly in the record, without having to look for them.
</Tip>

<div class="hr" />

## Common issues

<AccordionGroup>
  <Accordion title="I created the object but no records show up">
    Check the API names one by one. That's what fails in most cases:

    * The object must be `TrebleWhatsAppConversation__c`
    * The relationship field must be `Contact__c`
    * The messages field must be `Messages__c`

    A different name makes the write fail silently: Treble keeps creating the Task or Event, but not the custom object record.
  </Accordion>

  <Accordion title="The object exists but the integration user can't see it">
    When you create a custom object, Salesforce leaves permissions **disabled for all profiles** by default. Confirm that the profile of the user Treble connected with has read and create permissions on the object and its fields.
  </Accordion>

  <Accordion title="I use multi-object and don't know which object to relate it to">
    The master-detail relationship points to **a single** object. If your operation spreads people across several objects, talk to your Customer Success Manager before creating it, to define which one is best and what happens with the records of the others.
  </Accordion>

  <Accordion title="Messages look cut off">
    The field was created with a length lower than the maximum. Edit it and raise the length to `131072`.
  </Accordion>

  <Accordion title="Can I stop using the Task or Event and keep only this?">
    Not from the platform. Treble always writes the Task or Event; the custom object is additional. If the duplication gets in your way, talk to your Customer Success Manager.
  </Accordion>
</AccordionGroup>

<div class="hr" />

## Next steps

<CardGroup cols={2}>
  <Card title="Conversation history" icon="clock-rotate-left" href="/en/docs/integrations/salesforce/features/activities">
    When it's written and which fields are filled in on the Task or Event.
  </Card>

  <Card title="View WhatsApp inside Salesforce" icon="window-maximize" href="/en/docs/integrations/salesforce/embed/custom-tab">
    Reply to active conversations without leaving the CRM.
  </Card>
</CardGroup>


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