> For the complete documentation index, see [llms.txt](https://docs.perigee.software/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perigee.software/examples-and-demos/salesforce-watcher.md).

# SalesForce Watcher

## SalesForce Demo

To see the full demonstration of connecting to SalesForce, see the page dedicated to the SalesForce Connector

{% content-ref url="/pages/swMbXNPWQPzrCSDLJhus" %}
[SalesForce](/core-modules/event-sources/watchers/salesforce.md)
{% endcontent-ref %}

```csharp
PerigeeApplication.ApplicationNoInit("SalesForce Demo", (c) => {

    //Replace the details here
    var x509 = new X509Certificate2();
    
    c.AddSalesForceWatch<SFAccount>("WatchAccounts", "Account", "ConsumerKey", "ConsumerSecret, "User", x509, "login", 
    (ct, log, updated, deleted) => {

        //updated records, bound back to an SFAccount class
        foreach (var item in updated)
        {
            Console.WriteLine($"[{item.id}] {item.AccountName}({item.Type})");
        }

        //Deleted ID's, along with the deleted date
        foreach (var item in deleted)
        {
            Console.WriteLine($"{item.id} - {item.deletedDate:G}");
        }

    });

});
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.perigee.software/examples-and-demos/salesforce-watcher.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
