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

# SuperOffice.WebApi.Agents.ICRMScriptAgent

# \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent">\</a> Interface ICRMScriptAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Manage and execute CRMScript functions.
\<p>\</p>
\<b>Online Restricted:\</b> This agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
public interface ICRMScriptAgent : IAgentBase, IDisposable
```

#### Implements

[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_CreateDefaultCRMScriptEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultCRMScriptEntityAsync(RequestOptions)

Set default values into a new CRMScriptEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<CRMScriptEntity> CreateDefaultCRMScriptEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptEntity](SuperOffice.WebApi.Data.CRMScriptEntity.md)\&gt;

A blank CRMScriptEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_CreateDefaultTriggerScriptEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultTriggerScriptEntityAsync(RequestOptions)

Set default values into a new TriggerScriptEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
Task<TriggerScriptEntity> CreateDefaultTriggerScriptEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)\&gt;

A blank TriggerScriptEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_DeleteCRMScriptByUniqueIdentifierAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteCRMScriptByUniqueIdentifierAsync(string, RequestOptions)

Delete the CRMScript
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteCRMScriptByUniqueIdentifierAsync(string uniqueIdentifier, RequestOptions requestOptions = null)
```

#### Parameters

`uniqueIdentifier` [string](https://learn.microsoft.com/dotnet/api/system.string)

Global unique reference to script (independent of installation)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_DeleteCRMScriptEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteCRMScriptEntityAsync(int, RequestOptions)

Deletes the CRMScriptEntity
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteCRMScriptEntityAsync(int cRMScriptEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the CRMScriptEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_DeleteTriggerScriptByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteTriggerScriptByUniqueIdAsync(string, RequestOptions)

Delete a trigger CRMScript.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteTriggerScriptByUniqueIdAsync(string triggerScriptUniqueId, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

This method has no return value

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_DeleteTriggerScriptEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteTriggerScriptEntityAsync(int, RequestOptions)

Deletes the TriggerScriptEntity
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task DeleteTriggerScriptEntityAsync(int triggerScriptEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the TriggerScriptEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ExecuteScriptAsEventAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_EventData\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteScriptAsEventAsync(int, EventData, RequestOptions)

Execute a CRMScript with event data as input. Returns event data with output variable values.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EventData> ExecuteScriptAsEventAsync(int cRMScriptId, EventData eventData, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the CRMScript to execute

`eventData` [EventData](SuperOffice.WebApi.Data.EventData.md)

The EventData instance sent to the crmscript with input values

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EventData](SuperOffice.WebApi.Data.EventData.md)\&gt;

The EventData instance after script execution with output values

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ExecuteScriptAsEventByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_Data\_EventData\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteScriptAsEventByUniqueIdAsync(string, EventData, RequestOptions)

Execute a CRMScript with event data as input. Returns event data with output variable values.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<EventData> ExecuteScriptAsEventByUniqueIdAsync(string cRMScriptUniqueId, EventData eventData, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to execute

`eventData` [EventData](SuperOffice.WebApi.Data.EventData.md)

The EventData instance sent to the crmscript with input values

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[EventData](SuperOffice.WebApi.Data.EventData.md)\&gt;

The EventData instance after script execution with output values

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ExecuteScriptAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteScriptAsync(int, StringDictionary, RequestOptions)

Execute a CRMScript with parameters, returning printed output value.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> ExecuteScriptAsync(int cRMScriptId, StringDictionary parameters, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the CRMScript to execute

`parameters` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

Parameters passed as variables to the CRMScript

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

The output produced by the CRMScript

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ExecuteScriptByIncludeIdAsync\_System\_String\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteScriptByIncludeIdAsync(string, StringDictionary, RequestOptions)

Execute a CRMScript with parameters, returning printed output value.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> ExecuteScriptByIncludeIdAsync(string cRMScriptIncludeId, StringDictionary parameters, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptIncludeId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The include id of the CRMScript to validate

`parameters` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

Parameters passed as variables to the CRMScript

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

The output produced by the CRMScript

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ExecuteScriptByStringAsync\_System\_String\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_Data\_EventData\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteScriptByStringAsync(string, StringDictionary, EventData, RequestOptions)

Execute a CRMScript 2 (JavaScript), returning the printed output value.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptRunResult> ExecuteScriptByStringAsync(string script, StringDictionary parameters, EventData eventData, RequestOptions requestOptions = null)
```

#### Parameters

`script` [string](https://learn.microsoft.com/dotnet/api/system.string)

The script to execute

`parameters` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

Parameters passed as variables to the CRMScript

`eventData` [EventData](SuperOffice.WebApi.Data.EventData.md)

The EventData instance sent to the crmscript with input values

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptRunResult](SuperOffice.WebApi.Data.CRMScriptRunResult.md)\&gt;

The output produced by the CRMScript

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ExecuteScriptByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_Data\_StringDictionary\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ExecuteScriptByUniqueIdAsync(string, StringDictionary, RequestOptions)

Execute a CRMScript with parameters, returning printed output value.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<string> ExecuteScriptByUniqueIdAsync(string cRMScriptUniqueId, StringDictionary parameters, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to validate

`parameters` [StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

Parameters passed as variables to the CRMScript

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[string](https://learn.microsoft.com/dotnet/api/system.string)\&gt;

The output produced by the CRMScript

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_GetCRMScriptByUniqueIdentifierAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCRMScriptByUniqueIdentifierAsync(string, RequestOptions)

Get information about a script from a unique identifier
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<Script> GetCRMScriptByUniqueIdentifierAsync(string uniqueIdentifier, RequestOptions requestOptions = null)
```

#### Parameters

`uniqueIdentifier` [string](https://learn.microsoft.com/dotnet/api/system.string)

Global unique reference to script (independent of installation)

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Script](SuperOffice.WebApi.Data.Script.md)\&gt;

Information about CRMScript

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_GetCRMScriptEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetCRMScriptEntityAsync(int, RequestOptions)

Gets a specific CRMScriptEntity object.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptEntity> GetCRMScriptEntityAsync(int cRMScriptEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the CRMScriptEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptEntity](SuperOffice.WebApi.Data.CRMScriptEntity.md)\&gt;

CRMScriptEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_GetTriggerScriptByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTriggerScriptByUniqueIdAsync(string, RequestOptions)

Get a trigger CRMScript.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<TriggerScriptEntity> GetTriggerScriptByUniqueIdAsync(string triggerScriptUniqueId, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)\&gt;

Trigger script details and source code.

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_GetTriggerScriptEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetTriggerScriptEntityAsync(int, RequestOptions)

Gets a specific TriggerScriptEntity object.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<TriggerScriptEntity> GetTriggerScriptEntityAsync(int triggerScriptEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the TriggerScriptEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)\&gt;

TriggerScriptEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ResolveIncludesAsync\_System\_String\_System\_Boolean\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ResolveIncludesAsync(string, bool, RequestOptions)

Will resolve all includes for a TypeScript and return an array of the IDs
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<int[]> ResolveIncludesAsync(string script, bool ignoreErrors, RequestOptions requestOptions = null)
```

#### Parameters

`script` [string](https://learn.microsoft.com/dotnet/api/system.string)

The script to resolve includes for

`ignoreErrors` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

If true, then missing includes will be ignored

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\[]\&gt;

The ids of all the included scripts

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_SaveCRMScriptByUniqueIdentifierAsync\_System\_String\_SuperOffice\_WebApi\_Data\_Script\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveCRMScriptByUniqueIdentifierAsync(string, Script, RequestOptions)

Create or Update the CRMScript information
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<Script> SaveCRMScriptByUniqueIdentifierAsync(string uniqueIdentifier, Script crmscript, RequestOptions requestOptions = null)
```

#### Parameters

`uniqueIdentifier` [string](https://learn.microsoft.com/dotnet/api/system.string)

Global unique reference to script (independent of installation)

`crmscript` [Script](SuperOffice.WebApi.Data.Script.md)

Information about the CRMScript

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[Script](SuperOffice.WebApi.Data.Script.md)\&gt;

Information about the CRMScript as saved in the database

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_SaveCRMScriptEntityAsync\_SuperOffice\_WebApi\_Data\_CRMScriptEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveCRMScriptEntityAsync(CRMScriptEntity, RequestOptions)

Updates the existing CRMScriptEntity or creates a new CRMScriptEntity if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptEntity> SaveCRMScriptEntityAsync(CRMScriptEntity cRMScriptEntity, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptEntity` [CRMScriptEntity](SuperOffice.WebApi.Data.CRMScriptEntity.md)

The CRMScriptEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptEntity](SuperOffice.WebApi.Data.CRMScriptEntity.md)\&gt;

New or updated CRMScriptEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_SaveCRMScriptEntityWithoutCompileAsync\_SuperOffice\_WebApi\_Data\_CRMScriptEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveCRMScriptEntityWithoutCompileAsync(CRMScriptEntity, RequestOptions)

Save the script directly without compiling TypeScript
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptEntity> SaveCRMScriptEntityWithoutCompileAsync(CRMScriptEntity crmScriptEntity, RequestOptions requestOptions = null)
```

#### Parameters

`crmScriptEntity` [CRMScriptEntity](SuperOffice.WebApi.Data.CRMScriptEntity.md)

The entity to save. Source and SourceCode should both be specified

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptEntity](SuperOffice.WebApi.Data.CRMScriptEntity.md)\&gt;

The saved entity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_SaveTriggerScriptByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_Data\_TriggerScriptEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTriggerScriptByUniqueIdAsync(string, TriggerScriptEntity, RequestOptions)

Validate a CRMScript. This will check that the syntax is correct
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<TriggerScriptEntity> SaveTriggerScriptByUniqueIdAsync(string triggerScriptUniqueId, TriggerScriptEntity entity, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to validate

`entity` [TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)

Trigger script details and source code

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)\&gt;

Trigger script details and source code.

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_SaveTriggerScriptEntityAsync\_SuperOffice\_WebApi\_Data\_TriggerScriptEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveTriggerScriptEntityAsync(TriggerScriptEntity, RequestOptions)

Updates the existing TriggerScriptEntity or creates a new TriggerScriptEntity if the id parameter is 0.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<TriggerScriptEntity> SaveTriggerScriptEntityAsync(TriggerScriptEntity triggerScriptEntity, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptEntity` [TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)

The TriggerScriptEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[TriggerScriptEntity](SuperOffice.WebApi.Data.TriggerScriptEntity.md)\&gt;

New or updated TriggerScriptEntity

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ValidateScriptAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateScriptAsync(int, RequestOptions)

Validate a CRMScript. This will check that the syntax is correct
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptResult> ValidateScriptAsync(int cRMScriptId, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the CRMScript to execute

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptResult](SuperOffice.WebApi.Data.CRMScriptResult.md)\&gt;

True if the syntax is correct

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ValidateScriptByIncludeIdAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateScriptByIncludeIdAsync(string, RequestOptions)

Validate a CRMScript. This will check that the syntax is correct
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptResult> ValidateScriptByIncludeIdAsync(string cRMScriptIncludeId, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptIncludeId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The include id of the CRMScript to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptResult](SuperOffice.WebApi.Data.CRMScriptResult.md)\&gt;

True if the syntax is correct

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ValidateScriptByStringAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateScriptByStringAsync(string, RequestOptions)

Validate a CRMScript 2 (JavaScript). This will check that the syntax is correct
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptResult> ValidateScriptByStringAsync(string script, RequestOptions requestOptions = null)
```

#### Parameters

`script` [string](https://learn.microsoft.com/dotnet/api/system.string)

The script to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptResult](SuperOffice.WebApi.Data.CRMScriptResult.md)\&gt;

The result of the syntax check

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ValidateScriptByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateScriptByUniqueIdAsync(string, RequestOptions)

Validate a CRMScript. This will check that the syntax is correct
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptResult> ValidateScriptByUniqueIdAsync(string cRMScriptUniqueId, RequestOptions requestOptions = null)
```

#### Parameters

`cRMScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptResult](SuperOffice.WebApi.Data.CRMScriptResult.md)\&gt;

True if the syntax is correct

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ValidateTriggerScriptAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateTriggerScriptAsync(int, RequestOptions)

Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptResult> ValidateTriggerScriptAsync(int triggerScriptId, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the CRMScript Trigger to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptResult](SuperOffice.WebApi.Data.CRMScriptResult.md)\&gt;

True if the syntax is correct

### \<a id="SuperOffice\_WebApi\_Agents\_ICRMScriptAgent\_ValidateTriggerScriptByUniqueIdAsync\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ValidateTriggerScriptByUniqueIdAsync(string, RequestOptions)

Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
\<p>\</p>
\<b>Online Restricted:\</b> The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.

```csharp theme={null}
Task<CRMScriptResult> ValidateTriggerScriptByUniqueIdAsync(string triggerScriptUniqueId, RequestOptions requestOptions = null)
```

#### Parameters

`triggerScriptUniqueId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The unique id of the CRMScript to validate

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[CRMScriptResult](SuperOffice.WebApi.Data.CRMScriptResult.md)\&gt;

True if the syntax is correct


## Related topics

- [SuperOffice.WebApi.Agents.CRMScriptAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.CRMScriptAgent.md)
- [SuperOffice.WebApi.Agents.EMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.EMailAgent.md)
- [SuperOffice.WebApi.Agents.IEMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IEMailAgent.md)
- [SuperOffice.WebApi.Agents.IListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IListAgent.md)
- [SuperOffice.WebApi.Agents.ListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ListAgent.md)
- [SuperOffice.WebApi.Agents.IAIAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IAIAgent.md)
