Namespace: rest

CSL. rest

Contains all the methods for calling the REST service with custom scripting

Source:

Methods


.createViewFieldMappings(options)

Creates the view field mappings for each screen or grid.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
id string

Specify the id of the screen or grid.

viewFields Object

Specify the view field collection.

Source:

.executeMethod(options)

Calls the executeMethod endpoint of the REST call service for the given object and method. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Argument Description
object string

Specify the name of the object of the method to execute.

method string

Specify the name of the method to execute.

profile string

Specify the profile to execute the method on.

requestOptions Object <optional>

Specify the request options for this method.

Properties
Name Type Argument Description
Context Object <optional>

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise

.executeMultiRecord(options)

Calls the executeMultiRecord endpoint of the REST call service for the given object and multi record view. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Argument Description
object string

Specify the name of the object of the multi record view to execute.

view string

Specify the name of the multi view to execute.

requestOptions Object <optional>

Specify the request options for this method.

Properties
Name Type Argument Description
Context Object <optional>

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise

.executeView(options)

Calls the executeView endpoint of the REST call service for the given object and view. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Argument Description
object string

Specify the name of the object of the view to execute.

view string

Specify the name of the view to execute.

requestOptions Object <optional>

Specify the request options for this method.

Properties
Name Type Argument Description
Context Object <optional>

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise

.getFilterValues(options)

Calls the getFilterValues endpoint of the REST call service for the given object, view and view field. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Argument Description
object string

Specify the name of the object of the multi record view.

view string

Specify the name of the multi record view to execute.

viewFieldName string

Specify the name of the view field in the multi record view.

requestOptions Object <optional>

Specify the request options for this method.

Properties
Name Type Argument Description
Context Object <optional>

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise

.getMethodFieldIdByViewFieldName(options)

Get the internal name (the client safe id) by the original view field name.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
id string

Specify the id of the screen or grid.

viewFieldName String

The original name of the view field.

Source:
Returns:

The internal name (a guid which always begins with a letter).

Type
String

.getViewFieldDataSourceOutput(options)

Calls the getViewFieldDataSourceOutput endpoint of the REST call service for the given object and view. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId. The output directories have to be specified in the requestOptions.Context property.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
object string

Specify the name of the object of the multi record view.

view string

Specify the name of the multi record view to execute.

requestOptions Object

Specify the request options for this method.

Properties
Name Type Argument Description
Context Object

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise

.getViewFieldInternalName(options)

Get the internal name (the client safe id) of the view field name.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
id string

Specify the id of the screen or grid.

viewFieldName String

The original name of the view field.

Source:
Returns:

The internal name (a guid which always begins with a letter) of the view field.

Type
String

.getViewFieldInternalNameByMethodFieldId(options)

Get the internal name (the client safe id) of the view field for the given method output field.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
id string

Specify the id of the screen or grid.

methodField String

The internal name of the method output field.

Source:
Returns:

The internal name (a guid which always begins with a letter) of the corresponding view field.

Type
String

.getViewFieldNameByInternalName(options)

Get the original name of the view field internal name.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
id string

Specify the id of the screen or grid.

viewFieldInternalName String

The internal name of the view field.

Source:
Returns:

The original name of the view field.

Type
String

.getViewFieldNameOfMethodField(options)

Returns the view field name of the given method output field

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
id string

Specify the unique identifier of the screen or grid

methodField string

Specify the method output field

Source:
Returns:

The name of the view field

Type
string

.prepareView(options)

Calls the prepareView endpoint of the REST call service for the given object and view. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Argument Description
object string

Specify the name of the object of the view to prepare.

view string

Specify the name of the view to prepare.

requestOptions Object <optional>

Specify the request options for this method.

Properties
Name Type Argument Description
Context Object <optional>

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise

.validateValue(options)

Calls the validateValue endpoint of the REST call service for the given object, view and validation values. Request options can be passed as well. Request options that will be set by default
are CurrentUser, SourceSystem, SourceIdentifier and LocaleId.

Parameters:
Name Type Description
options Object

Specify the options for this method.

Properties
Name Type Description
object string

Specify the name of the object of the multi record view.

view string

Specify the name of the multi record view to execute.

requestOptions Object

Specify the request options for this method.

Properties
Name Type Argument Description
ValuesToValidate Object

Specify the values to validate. The key is the name of the view field, the value an array of values to validate.

Context Object <optional>

Specify the context records to send to the REST service. Can be an array.

RowKeys Array.<string> <optional>

Specify a unique identifier for each record of the Context property.

QueryOptions Object <optional>

Specify the options for the query that prepares the view.

Properties
Name Type Argument Description
FirstItem integer <optional>

Specify the index of the first item that has to be fetched.

PageSize Integer <optional>

Specify the amount of records to fetch.

Expression Object <optional>

Specify a filter object that is returned from the CSL.filter.parseFilterExpression method.

OrderByFields Object <optional>

Specify a sort object that is returned from the CSL.filter.parseSortExpression method.

Source:
Throws:

Will throw an error if any required input field has not been set.

Returns:

A promise that is resolved when the call is successfully executed. If the call failed, the promise is rejected.

Type
Promise