Working with Salesforce Objects

Overview

Interacting with Salesforce objects is a core functionality when integrating Salesforce with Kognitos. This section covers how to fetch data, create and modify Salesforce objects, and delete them when necessary.

Fetching Data using custom SQL queries

To fetch data from Salesforce using custom SQL queries:

fetch the records from salesforce where
  the query is "SELECT Id, Email FROM Contact"

Fetching Data using Direct Queries

To fetch data from Salesforce using direct queries:

get salesforce's leads whose annual revenue is less than 1000000000

Creating and Modifying Salesforce Objects

Adding New Records

To add a new record to Salesforce, you need to specify the type of object you're creating and provide the necessary field values. Example:

the opportunity is
    the name is "New Deal"
    the close date is "2023-12-31"
    the stage is "Prospecting"
add the opportunity in salesforce

This creates a new opportunity named "New Deal" with a close date and stage specified.

Updating Existing Records

To update an existing Salesforce object, you must identify the object by its ID and specify the fields you want to update. Example:

the opportunity's ID is "006xx000001Sv6aAAC"
change the opportunity's stage to "Closed Won" in salesforce

This updates the stage of the specified opportunity to "Closed Won".

Deleting Salesforce Objects

Single Deletion

To delete a specific Salesforce object, you need to specify the object and its ID.

Example:

the salesobject's ID is "006xx000001Sv6aAAC"
delete the salesobject

This command deletes the sales object with the specified ID.

Creating a new lead in Salesforce

To create a new lead in Salesforce:

Create a lead in salesforce with
  the lead status is "New"
  the last name is "Hackmann Test"
  the company is the lead company
  the email is the lead email
  the lead source is "Other Campaigns"

Last updated

Was this helpful?