# DeleteSObject

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Salesforce/tree/main/Frends.Salesforce.DeleteSObject>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                   | Description                                                                                                                                                              |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| SObjectId : `String`   | <p>SObject id.</p><p><br>Default: <code>-</code><br>Example: <code>abcdefghijkl123456789</code></p>                                                                      |
| SObjectType : `String` | <p>SObject type. Can be Account, Case, CustomObject, CustomSettings, CustomMetadata, etc...</p><p><br>Default: <code>Account</code><br>Example: <code>Account</code></p> |
| {% endtab %}           |                                                                                                                                                                          |

{% tab title="Parameter: Connection" %}

| Name                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AuthenticationMethod : `AuthenticationMethod` | <p>Authentication method used to get a Salesforce access token.</p><p>Possible values:</p><ul><li><code>AccessToken</code>:</li></ul><p>Authentication method used to get a Salesforce access token.</p><ul><li><code>OAuth2WithPassword</code>:</li></ul><p>Authentication method used to get a Salesforce access token.</p><ul><li><code>OAuth2WithClientCredentials</code>:</li></ul><p>Authentication method used to get a Salesforce access token.</p><p><br>Default: <code>1</code><br>Example: <code>UsernamePasswordOAuth</code></p> |
| InstanceUrl : `String`                        | <p>Salesforce instance URL. Required when using the AccessToken authentication method.</p><p><br>Default: <code>-</code><br>Example: <code><https://mydomain.my.salesforce.com></code></p>                                                                                                                                                                                                                                                                                                                                                   |
| AuthUrl : `String`                            | <p>Url used to authenticate to Salesforce with the OAuth2 password flow.</p><p><br>Default: <code><https://login.salesforce.com></code><br>Example: <code><https://mydomain.my.salesforce.com></code></p>                                                                                                                                                                                                                                                                                                                                    |
| 🗝AccessToken : `String`                      | <p>Reusable Salesforce access token. Required when using the AccessToken authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>00Dxx0000000001!AQ8AQExampleToken</code></p>                                                                                                                                                                                                                                                                                                                                             |
| ClientId : `String`                           | <p>OAuth connected app client ID.</p><p><br>Default: <code>-</code><br>Example: <code>3MVG9d8..ExampleClientId</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 🗝ClientSecret : `String`                     | <p>OAuth connected app client secret.</p><p><br>Default: <code>-</code><br>Example: <code>ExampleClientSecret</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Username : `String`                           | <p>Salesforce username.</p><p><br>Default: <code>-</code><br>Example: <code><integration.user@example.com></code></p>                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 🗝Password : `String`                         | <p>Salesforce password.</p><p><br>Default: <code>-</code><br>Example: <code>ExamplePassword</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| 🗝SecurityToken : `String`                    | <p>Salesforce security token appended to the password for the username-password OAuth flow when required.</p><p><br>Default: <code>-</code><br>Example: <code>ExampleSecurityToken</code></p>                                                                                                                                                                                                                                                                                                                                                |
| ApiVersion : `String`                         | <p>The API version to use when making requests to Salesforce.</p><p>If left empty, the default value is v61.0.</p><p><br>Default: <code>v61.0</code><br>Example: <code>-</code></p>                                                                                                                                                                                                                                                                                                                                                          |
| ReturnAccessToken : `Boolean`                 | <p>Also return access token which is fetched during authentication?</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                  |
| ThrowAnErrorIfNotFound : `Boolean`            | <p>Set whether process will throw an error if targeted id can not be found from Salesforce.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                          |
| {% endtab %}                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

{% tab title="Result: Result" %}

| Name                            | Description                                                                                                                                       |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Body : `Object`                 | <p>Body of the response.<br>Example: <code>{"id": "abcdefghijkl123456789", "success": true, "errors": \[]}</code></p>                             |
| RequestIsSuccessful : `Boolean` | <p>Was the request successful?<br>Example: <code>true</code></p>                                                                                  |
| ErrorException : `Exception`    | <p>Exception that was thrown by the server.<br>Example: <code>System.Net.Http.HttpRequestException</code></p>                                     |
| ErrorMessage : `String`         | <p>Error message from the server.<br>Example: <code>System.Net.Http.HttpRequestException: Request failed with status code Unauthorized</code></p> |
| Token : `String`                | <p>OAuth2 access token.<br>Example: <code>abcdefghjklmn123456789</code></p>                                                                       |
| {% endtab %}                    |                                                                                                                                                   |

{% tab title="Changelog" %}

## Changelog

### \[3.0.0] - 2026-04-01

#### Changed

* \[Breaking Change] Move parameters related to Connection to new Connection parameter.
* Remove the empty Options parameter.
* Improve validation of input parameters.

#### Added

* Added a new authentication method for authentication by OAuth2 with client credentials

### \[2.2.0] - 2025-12-12

#### Changed

* Change throwing exception logic

### \[2.1.0] - 2025-03-18

#### Changed

* Update packages: Newtonsoft.Json 13.0.1 -> 13.0.3 RestSharp 107.3.0 -> 112.1.0 System.ComponentModel.Annotations 4.7.0 -> 5.0.0 coverlet.collector 3.1.0 -> 6.0.4 dotenv.net 3.2.0 -> 3.2.1 Microsoft.NET.Test.Sdk 16.7.0 -> 17.13.0 MSTest.TestAdapter 2.1.2 -> 3.8.3 MSTest.TestFramework 2.1.2 -> 3.8.3 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0

### \[2.0.0] - 2024-08-19

#### Added

* Salesforce API version number can now be specified in input.

### \[1.1.0] - 2024-08-28

#### Changed

* Documentation link now links to a correct page in Frends Tasks.

### \[1.0.1] - 2022-05-27

#### Changed

* Fix for issue with referencing result-object in other elements.

### \[1.0.0] - 2022-05-09

#### Added

* Initial implementation of Frends.Salesforce.DeleteSObject.
  {% endtab %}
  {% endtabs %}
