Skip to main content

Interface ICRMScriptAgent

Namespace: SuperOffice.WebApi.Agents
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.

Implements

IAgentBase, IDisposable

Methods

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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptEntity&gt; A blank CRMScriptEntity

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

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TriggerScriptEntity&gt; A blank TriggerScriptEntity

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.

Parameters

uniqueIdentifier string Global unique reference to script (independent of installation) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

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.

Parameters

cRMScriptEntityId int The identity of the CRMScriptEntity requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

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.

Parameters

triggerScriptUniqueId string The unique id of the CRMScript to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

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.

Parameters

triggerScriptEntityId int The identity of the TriggerScriptEntity requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

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.

Parameters

cRMScriptId int The id of the CRMScript to execute eventData EventData The EventData instance sent to the crmscript with input values requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<EventData&gt; The EventData instance after script execution with output values

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.

Parameters

cRMScriptUniqueId string The unique id of the CRMScript to execute eventData EventData The EventData instance sent to the crmscript with input values requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<EventData&gt; The EventData instance after script execution with output values

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.

Parameters

cRMScriptId int The id of the CRMScript to execute parameters StringDictionary Parameters passed as variables to the CRMScript requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The output produced by the CRMScript

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.

Parameters

cRMScriptIncludeId string The include id of the CRMScript to validate parameters StringDictionary Parameters passed as variables to the CRMScript requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The output produced by the CRMScript

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.

Parameters

script string The script to execute parameters StringDictionary Parameters passed as variables to the CRMScript eventData EventData The EventData instance sent to the crmscript with input values requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptRunResult&gt; The output produced by the CRMScript

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.

Parameters

cRMScriptUniqueId string The unique id of the CRMScript to validate parameters StringDictionary Parameters passed as variables to the CRMScript requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The output produced by the CRMScript

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.

Parameters

uniqueIdentifier string Global unique reference to script (independent of installation) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Script&gt; Information about CRMScript

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.

Parameters

cRMScriptEntityId int The identifier of the CRMScriptEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptEntity&gt; CRMScriptEntity

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.

Parameters

triggerScriptUniqueId string The unique id of the CRMScript to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TriggerScriptEntity&gt; Trigger script details and source code.

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.

Parameters

triggerScriptEntityId int The identifier of the TriggerScriptEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TriggerScriptEntity&gt; TriggerScriptEntity

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.

Parameters

script string The script to resolve includes for ignoreErrors bool If true, then missing includes will be ignored requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int[]&gt; The ids of all the included scripts

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.

Parameters

uniqueIdentifier string Global unique reference to script (independent of installation) crmscript Script Information about the CRMScript requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Script&gt; Information about the CRMScript as saved in the database

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.

Parameters

cRMScriptEntity CRMScriptEntity The CRMScriptEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptEntity&gt; New or updated CRMScriptEntity

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.

Parameters

crmScriptEntity CRMScriptEntity The entity to save. Source and SourceCode should both be specified requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptEntity&gt; The saved entity

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.

Parameters

triggerScriptUniqueId string The unique id of the CRMScript to validate entity TriggerScriptEntity Trigger script details and source code requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TriggerScriptEntity&gt; Trigger script details and source code.

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.

Parameters

triggerScriptEntity TriggerScriptEntity The TriggerScriptEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TriggerScriptEntity&gt; New or updated TriggerScriptEntity

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.

Parameters

cRMScriptId int The id of the CRMScript to execute requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptResult&gt; True if the syntax is correct

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.

Parameters

cRMScriptIncludeId string The include id of the CRMScript to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptResult&gt; True if the syntax is correct

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.

Parameters

script string The script to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptResult&gt; The result of the syntax check

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.

Parameters

cRMScriptUniqueId string The unique id of the CRMScript to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptResult&gt; True if the syntax is correct

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.

Parameters

triggerScriptId int The id of the CRMScript Trigger to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptResult&gt; True if the syntax is correct

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.

Parameters

triggerScriptUniqueId string The unique id of the CRMScript to validate requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<CRMScriptResult&gt; True if the syntax is correct