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

# Salesforce Prerelease Functions

## Await bulk upload job completion

**Function name:** `AwaitSalesforceBulkJobCompletionFunction`
**Category:** Read
**Destination:** Salesforce Prerelease

Polls until a bulk upload job enters a completion state.

### Parameters

| Name                       | Label       | Required | Description                                         |
| -------------------------- | ----------- | :------: | --------------------------------------------------- |
| `jobIdPath`                | Job ID path |    Yes   | The state path where the job ID is stored.          |
| `integrationCredentialsId` | Credentials |    Yes   | Salesforce credentials to use.                      |
| `apiVersion`               | API version |    No    | Salesforce API version. If not set defaults to 62.0 |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Complete bulk upload job

**Function name:** `CompleteSalesforceBulkUploadFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Marks a bulk upload job as completed, indicating that no more data will be sent and the job should be processed.

### Parameters

| Name                       | Label       | Required | Description                                         |
| -------------------------- | ----------- | :------: | --------------------------------------------------- |
| `jobIdPath`                | Job ID path |    Yes   | The state path where the job ID is stored.          |
| `integrationCredentialsId` | Credentials |    Yes   | Salesforce credentials to use.                      |
| `apiVersion`               | API version |    No    | Salesforce API version. If not set defaults to 62.0 |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Create bulk upload job

**Function name:** `CreateSalesforceBulkJobFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Creates a bulk upload job for the specified object.

### Parameters

| Name                       | Label                  | Required | Description                                                                           |
| -------------------------- | ---------------------- | :------: | ------------------------------------------------------------------------------------- |
| `object`                   | Object                 |    Yes   | Type of object to create a bulk upload job for.                                       |
| `operation`                | Operation              |    Yes   | The operation to perform.                                                             |
| `integrationCredentialsId` | Credentials            |    Yes   | Salesforce credentials to use.                                                        |
| `externalIdFieldName`      | External ID field name |    No    | The external ID field in the object being updated. Only needed for upsert operations. |
| `apiVersion`               | API version            |    No    | Salesforce API version. If not set defaults to 62.0                                   |
| `jobIdPath`                | Job ID path            |    Yes   | The state path where the job ID should be stored.                                     |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Create Salesforce object

**Function name:** `CreateSalesforceObjectFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Creates Salesforce object

### Parameters

| Name                            | Label                | Required | Description                                                           |
| ------------------------------- | -------------------- | :------: | --------------------------------------------------------------------- |
| `integrationCredentialsId`      | Credentials          |    Yes   | Salesforce credentials to use.                                        |
| `apiVersion`                    | API version          |    No    | Salesforce API version. If not set defaults to 62.0                   |
| `resourceName`                  | Resource Name        |    Yes   | Name of the Salesforce object resource                                |
| `resource`                      | Resource             |    Yes   | Resource to be created                                                |
| `outputResourceIdStateVariable` | Output resource name |    Yes   | Name of the variable by which the resource ID will be stored in state |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Delete Salesforce object

**Function name:** `DeleteSalesforceObjectFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Deletes Salesforce object

### Parameters

| Name                       | Label         | Required | Description                                                          |
| -------------------------- | ------------- | :------: | -------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials   |    Yes   | Salesforce credentials to use.                                       |
| `apiVersion`               | API version   |    No    | Salesforce API version. If not set defaults to 62.0                  |
| `resourceName`             | Resource Name |    Yes   | Name of the Salesforce object resource                               |
| `resourceIdStateVariable`  | Resource ID   |    Yes   | Name of variable by which resource ID should be retrieved from state |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Ingest Salesforce invoice

**Function name:** `IngestSalesforceInvoiceFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Ingests an invoice into Salesforce using the Invoice Ingestion API. Builds the invoice graph from the provided invoice and line item objects, automatically wiring the invoiceId relationship onto each line item.

### Parameters

| Name                           | Label                           | Required | Description                                                                                                                         |
| ------------------------------ | ------------------------------- | :------: | ----------------------------------------------------------------------------------------------------------------------------------- |
| `integrationCredentialsId`     | Credentials                     |    Yes   | Salesforce credentials to use.                                                                                                      |
| `apiVersion`                   | API version                     |    No    | Salesforce API version. If not set defaults to 62.0                                                                                 |
| `invoiceStateVariable`         | Invoice state variable          |    Yes   | State variable containing the invoice object with all header fields pre-populated.                                                  |
| `lineItemsStateVariable`       | Line items state variable       |    Yes   | State variable containing the list of invoice line item objects with all fields pre-populated.                                      |
| `billingAddressStateVariable`  | Billing address state variable  |    Yes   | State variable containing the billing address object, used to create the billing InvoiceAddressGroup record.                        |
| `shippingAddressStateVariable` | Shipping address state variable |    No    | Optional. State variable containing the shipping address object. If not provided, the billing address is used for shipping as well. |
| `outputStateVariable`          | Output state variable           |    Yes   | State variable name to store the ingestion response.                                                                                |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Query Salesforce Object

**Function name:** `QuerySalesforceSingleObjectFunction`
**Category:** Read
**Destination:** Salesforce Prerelease

Reads a single Salesforce object using a SOQL query. If the query doesn't return a single result the workflow will fail.

### Parameters

| Name                       | Label       | Required | Description                                                      |
| -------------------------- | ----------- | :------: | ---------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials |    Yes   | Salesforce credentials to use.                                   |
| `apiVersion`               | API version |    No    | Salesforce API version. If not set defaults to 62.0              |
| `soqlQuery`                | Query       |    Yes   | Query to run                                                     |
| `stateVariable`            | Output data |    Yes   | Name of the variable by which the object will be stored in state |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Read Salesforce bulk job successful results

**Function name:** `ReadSalesforceBulkJobResultsFunction`
**Category:** Read
**Destination:** Salesforce Prerelease

Opens a streaming iterator over the successful results of a Salesforce bulk upload job. Rows are read incrementally without loading the full response into memory.

### Parameters

| Name                         | Label                | Required | Description                                                    |
| ---------------------------- | -------------------- | :------: | -------------------------------------------------------------- |
| `jobIdPath`                  | Job ID path          |    Yes   | State path where the bulk upload job ID is stored.             |
| `integrationCredentialsId`   | Credentials          |    Yes   | Salesforce credentials to use.                                 |
| `apiVersion`                 | API version          |    No    | Salesforce API version. If not set defaults to 62.0            |
| `outputResultsStateVariable` | Output iterator name |    Yes   | Name under which the results iterator will be stored in state. |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Read Salesforce object

**Function name:** `ReadSalesforceObjectFunction`
**Category:** Read
**Destination:** Salesforce Prerelease

Reads Salesforce object

### Parameters

| Name                          | Label                | Required | Description                                                          |
| ----------------------------- | -------------------- | :------: | -------------------------------------------------------------------- |
| `integrationCredentialsId`    | Credentials          |    Yes   | Salesforce credentials to use.                                       |
| `apiVersion`                  | API version          |    No    | Salesforce API version. If not set defaults to 62.0                  |
| `resourceName`                | Resource Name        |    Yes   | Name of the Salesforce object resource                               |
| `resourceIdStateVariable`     | Resource ID          |    Yes   | Name of variable by which resource ID should be retrieved from state |
| `resourceOutputStateVariable` | Output resource name |    Yes   | Name of the variable by which the resource will be stored in state   |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Read Salesforce objects using SOQL query

**Function name:** `SOQLSalesforceQueryFunction`
**Category:** Read
**Destination:** Salesforce Prerelease

Reads Salesforce object using SOQL query

### Parameters

| Name                         | Label               | Required | Description                                                                |
| ---------------------------- | ------------------- | :------: | -------------------------------------------------------------------------- |
| `integrationCredentialsId`   | Credentials         |    Yes   | Salesforce credentials to use.                                             |
| `apiVersion`                 | API version         |    No    | Salesforce API version. If not set defaults to 62.0                        |
| `soqlQuery`                  | Query               |    Yes   | Query to run                                                               |
| `outputResultsStateVariable` | Output results name |    Yes   | Name of the variable by which the objects iterator will be stored in state |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Set Salesforce External URL

**Function name:** `SalesforceSetExternalUrlFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Sets the external URL in the integration state to the Lightning Experience URL of a Salesforce record.

### Parameters

| Name                       | Label       | Required | Description                                             |
| -------------------------- | ----------- | :------: | ------------------------------------------------------- |
| `integrationCredentialsId` | Credentials |    Yes   | Salesforce credentials to use.                          |
| `objectType`               | Object Type |    Yes   | The Salesforce object type (e.g. Opportunity, Account). |
| `objectId`                 | Object ID   |    Yes   | State variable containing the Salesforce record ID.     |

### Exits

| Exit   | Description |
| ------ | ----------- |
| `NEXT` | -           |

## Update Salesforce object

**Function name:** `UpdateSalesforceObjectFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Updates Salesforce object

### Parameters

| Name                       | Label         | Required | Description                                                          |
| -------------------------- | ------------- | :------: | -------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials   |    Yes   | Salesforce credentials to use.                                       |
| `apiVersion`               | API version   |    No    | Salesforce API version. If not set defaults to 62.0                  |
| `resourceName`             | Resource Name |    Yes   | Name of the Salesforce object resource                               |
| `resourceIdStateVariable`  | Resource ID   |    Yes   | Name of variable by which resource ID should be retrieved from state |
| `resource`                 | Resource      |    Yes   | Resource to be updated                                               |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Upload bulk job data

**Function name:** `UploadSalesforceBulkJobDataFunction`
**Category:** Write
**Destination:** Salesforce Prerelease

Uploads data from a list or iterator to Salesforce. Data is automatically split into batches when necessary.

### Parameters

| Name                       | Label       | Required | Description                                                                   |
| -------------------------- | ----------- | :------: | ----------------------------------------------------------------------------- |
| `jobIdPath`                | Job ID path |    Yes   | The state path where the job ID is stored.                                    |
| `dataPath`                 | Data path   |    Yes   | The state variable containing the data that should be uploaded to Salesforce. |
| `integrationCredentialsId` | Credentials |    Yes   | Salesforce credentials to use.                                                |
| `apiVersion`               | API version |    No    | Salesforce API version. If not set defaults to 62.0                           |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |
