Interface ICRMScriptAgent
Interface for the CRMScript Agent Manage and execute CRMScript functions.
Online Restricted: This agent is not available in Online by default. Access must be requested specifically when app is registered.Syntax
[Agent("CRMScript Agent", "Interface for the CRMScript Agent. Manage and execute CRMScript functions.")]
public interface ICRMScriptAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
Methods
CreateDefaultCRMScriptEntity()
Loading default values into a new CRMScriptEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptEntity CreateDefaultCRMScriptEntity()
Returns
Type | Description |
---|---|
CRMScriptEntity | New CRMScriptEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
CreateDefaultTriggerScriptEntity()
Loading default values into a new TriggerScriptEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
TriggerScriptEntity CreateDefaultTriggerScriptEntity()
Returns
Type | Description |
---|---|
TriggerScriptEntity | New TriggerScriptEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
DeleteCRMScriptByUniqueIdentifier(String)
Delete the CRMScript
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
void DeleteCRMScriptByUniqueIdentifier(string uniqueIdentifier)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueIdentifier | Global unique reference to script (independent of installation) |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
DeleteCRMScriptEntity(Int32)
Deletes the CRMScriptEntity
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
void DeleteCRMScriptEntity(int cRMScriptEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cRMScriptEntityId | The identity of the CRMScriptEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
DeleteTriggerScriptByUniqueId(String)
Delete a trigger CRMScript.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
void DeleteTriggerScriptByUniqueId(string triggerScriptUniqueId)
Parameters
Type | Name | Description |
---|---|---|
String | triggerScriptUniqueId | The unique id of the CRMScript to validate |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
DeleteTriggerScriptEntity(Int32)
Deletes the TriggerScriptEntity
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
void DeleteTriggerScriptEntity(int triggerScriptEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | triggerScriptEntityId | The identity of the TriggerScriptEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ExecuteScript(Int32, StringDictionary)
Execute a CRMScript with parameters, returning printed output value.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
string ExecuteScript(int cRMScriptId, StringDictionary parameters)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cRMScriptId | The id of the CRMScript to execute |
StringDictionary | parameters | Parameters passed as variables to the CRMScript |
Returns
Type | Description |
---|---|
String | The output produced by the CRMScript |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ExecuteScriptAsEvent(Int32, EventData)
Execute a CRMScript with event data as input. Returns event data with output variable values.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EventData ExecuteScriptAsEvent(int cRMScriptId, EventData eventData)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cRMScriptId | The id of the CRMScript to execute |
EventData | eventData | The EventData instance sent to the crmscript with input values |
Returns
Type | Description |
---|---|
EventData | The EventData instance after script execution with output values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ExecuteScriptAsEventByUniqueId(String, EventData)
Execute a CRMScript with event data as input. Returns event data with output variable values.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
EventData ExecuteScriptAsEventByUniqueId(string cRMScriptUniqueId, EventData eventData)
Parameters
Type | Name | Description |
---|---|---|
String | cRMScriptUniqueId | The unique id of the CRMScript to execute |
EventData | eventData | The EventData instance sent to the crmscript with input values |
Returns
Type | Description |
---|---|
EventData | The EventData instance after script execution with output values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ExecuteScriptByIncludeId(String, StringDictionary)
Execute a CRMScript with parameters, returning printed output value.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
string ExecuteScriptByIncludeId(string cRMScriptIncludeId, StringDictionary parameters)
Parameters
Type | Name | Description |
---|---|---|
String | cRMScriptIncludeId | The include id of the CRMScript to validate |
StringDictionary | parameters | Parameters passed as variables to the CRMScript |
Returns
Type | Description |
---|---|
String | The output produced by the CRMScript |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ExecuteScriptByString(String, StringDictionary, EventData)
Execute a CRMScript 2 (JavaScript), returning the printed output value.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptRunResult ExecuteScriptByString(string script, StringDictionary parameters, EventData eventData)
Parameters
Type | Name | Description |
---|---|---|
String | script | The script to execute |
StringDictionary | parameters | Parameters passed as variables to the CRMScript |
EventData | eventData | The EventData instance sent to the crmscript with input values |
Returns
Type | Description |
---|---|
CRMScriptRunResult | The output produced by the CRMScript |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ExecuteScriptByUniqueId(String, StringDictionary)
Execute a CRMScript with parameters, returning printed output value.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
string ExecuteScriptByUniqueId(string cRMScriptUniqueId, StringDictionary parameters)
Parameters
Type | Name | Description |
---|---|---|
String | cRMScriptUniqueId | The unique id of the CRMScript to validate |
StringDictionary | parameters | Parameters passed as variables to the CRMScript |
Returns
Type | Description |
---|---|
String | The output produced by the CRMScript |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
GetCRMScriptByUniqueIdentifier(String)
Get information about a script from a unique identifier
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
Script GetCRMScriptByUniqueIdentifier(string uniqueIdentifier)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueIdentifier | Global unique reference to script (independent of installation) |
Returns
Type | Description |
---|---|
Script | Information about CRMScript |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
GetCRMScriptEntity(Int32)
Gets a CRMScriptEntity object.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptEntity GetCRMScriptEntity(int cRMScriptEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cRMScriptEntityId | The identifier of the CRMScriptEntity object |
Returns
Type | Description |
---|---|
CRMScriptEntity | CRMScriptEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
GetTriggerScriptByUniqueId(String)
Get a trigger CRMScript.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
TriggerScriptEntity GetTriggerScriptByUniqueId(string triggerScriptUniqueId)
Parameters
Type | Name | Description |
---|---|---|
String | triggerScriptUniqueId | The unique id of the CRMScript to validate |
Returns
Type | Description |
---|---|
TriggerScriptEntity | Trigger script details and source code. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
GetTriggerScriptEntity(Int32)
Gets a TriggerScriptEntity object.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
TriggerScriptEntity GetTriggerScriptEntity(int triggerScriptEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | triggerScriptEntityId | The identifier of the TriggerScriptEntity object |
Returns
Type | Description |
---|---|
TriggerScriptEntity | TriggerScriptEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ResolveIncludes(String, Boolean)
Will resolve all includes for a TypeScript and return an array of the IDs
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
int[] ResolveIncludes(string script, bool ignoreErrors)
Parameters
Type | Name | Description |
---|---|---|
String | script | The script to resolve includes for |
Boolean | ignoreErrors | If true, then missing includes will be ignored |
Returns
Type | Description |
---|---|
Int32[] | The ids of all the included scripts |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
SaveCRMScriptByUniqueIdentifier(String, Script)
Create or Update the CRMScript information
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
Script SaveCRMScriptByUniqueIdentifier(string uniqueIdentifier, Script crmscript)
Parameters
Type | Name | Description |
---|---|---|
String | uniqueIdentifier | Global unique reference to script (independent of installation) |
Script | crmscript | Information about the CRMScript |
Returns
Type | Description |
---|---|
Script | Information about the CRMScript as saved in the database |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
SaveCRMScriptEntity(CRMScriptEntity)
Updates the existing CRMScriptEntity or creates a new CRMScriptEntity if the id parameter is empty
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptEntity SaveCRMScriptEntity(CRMScriptEntity cRMScriptEntity)
Parameters
Type | Name | Description |
---|---|---|
CRMScriptEntity | cRMScriptEntity | The CRMScriptEntity that is saved. |
Returns
Type | Description |
---|---|
CRMScriptEntity | New or updated CRMScriptEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
SaveCRMScriptEntityWithoutCompile(CRMScriptEntity)
Save the script directly without compiling TypeScript
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptEntity SaveCRMScriptEntityWithoutCompile(CRMScriptEntity crmScriptEntity)
Parameters
Type | Name | Description |
---|---|---|
CRMScriptEntity | crmScriptEntity | The entity to save. Source and SourceCode should both be specified |
Returns
Type | Description |
---|---|
CRMScriptEntity | The saved entity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
SaveTriggerScriptByUniqueId(String, TriggerScriptEntity)
Validate a CRMScript. This will check that the syntax is correct
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
TriggerScriptEntity SaveTriggerScriptByUniqueId(string triggerScriptUniqueId, TriggerScriptEntity entity)
Parameters
Type | Name | Description |
---|---|---|
String | triggerScriptUniqueId | The unique id of the CRMScript to validate |
TriggerScriptEntity | entity | Trigger script details and source code |
Returns
Type | Description |
---|---|
TriggerScriptEntity | Trigger script details and source code. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
SaveTriggerScriptEntity(TriggerScriptEntity)
Updates the existing TriggerScriptEntity or creates a new TriggerScriptEntity if the id parameter is empty
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
TriggerScriptEntity SaveTriggerScriptEntity(TriggerScriptEntity triggerScriptEntity)
Parameters
Type | Name | Description |
---|---|---|
TriggerScriptEntity | triggerScriptEntity | The TriggerScriptEntity that is saved. |
Returns
Type | Description |
---|---|
TriggerScriptEntity | New or updated TriggerScriptEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ValidateScript(Int32)
Validate a CRMScript. This will check that the syntax is correct
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptResult ValidateScript(int cRMScriptId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cRMScriptId | The id of the CRMScript to execute |
Returns
Type | Description |
---|---|
CRMScriptResult | True if the syntax is correct |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ValidateScriptByIncludeId(String)
Validate a CRMScript. This will check that the syntax is correct
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptResult ValidateScriptByIncludeId(string cRMScriptIncludeId)
Parameters
Type | Name | Description |
---|---|---|
String | cRMScriptIncludeId | The include id of the CRMScript to validate |
Returns
Type | Description |
---|---|
CRMScriptResult | True if the syntax is correct |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ValidateScriptByString(String)
Validate a CRMScript 2 (JavaScript). This will check that the syntax is correct
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptResult ValidateScriptByString(string script)
Parameters
Type | Name | Description |
---|---|---|
String | script | The script to validate |
Returns
Type | Description |
---|---|
CRMScriptResult | The result of the syntax check |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ValidateScriptByUniqueId(String)
Validate a CRMScript. This will check that the syntax is correct
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptResult ValidateScriptByUniqueId(string cRMScriptUniqueId)
Parameters
Type | Name | Description |
---|---|---|
String | cRMScriptUniqueId | The unique id of the CRMScript to validate |
Returns
Type | Description |
---|---|
CRMScriptResult | True if the syntax is correct |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ValidateTriggerScript(Int32)
Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptResult ValidateTriggerScript(int triggerScriptId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | triggerScriptId | The id of the CRMScript Trigger to validate |
Returns
Type | Description |
---|---|
CRMScriptResult | True if the syntax is correct |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}
ValidateTriggerScriptByUniqueId(String)
Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
Online Restricted: The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.Declaration
CRMScriptResult ValidateTriggerScriptByUniqueId(string triggerScriptUniqueId)
Parameters
Type | Name | Description |
---|---|---|
String | triggerScriptUniqueId | The unique id of the CRMScript to validate |
Returns
Type | Description |
---|---|
CRMScriptResult | True if the syntax is correct |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (CRMScriptAgent agent = new CRMScriptAgent())
{
// call methods on agent here...
}
}