This file contains custom functions specific to the Rosetta language

Methods

(inner) context(ctxopt) → {string}

Gets the current API context (if ctx param is null or not supplied) or Sets the API context to either database for local DOM, for those APIs that require working with differents contexts such as GetField/SetField Note: this API is not derived from an existing Lotus Notes Formula function. Instead, it is needed to set the acting context for the GetField and SetField functions.

Parameters:
NameTypeAttributesDescription
ctxstring<optional>

the context to set: 'db', 'local', or 'all' (default for any other string supplied)

Returns:

the context

Type: 
string

(inner) debug(msg, type) → {Object|undefined}

Uses the console object's methods to display Debug messages, prepending them with a timestamp. Defaults to console.log() if * no type of logger is supplied. Note: this API is not derived from an existing Lotus Notes Formula function

Parameters:
NameTypeDescription
msgstring

message

typestring

logger to employ: 'Error', 'Warning', 'Info', 'Debug', 'Log' from the console object, or javascript alert if type is Alert

Returns:
  • Object representing the debug message

    Type: 
    Object
  • undefined if no logger is available

    Type: 
    undefined

(inner) restfulAPI(url, method, headers, body, additionalRequestParams) → {Promise.<any>}

Function to call a restful API.

Parameters:
NameTypeDefaultDescription
urlstring

The URL of the REST service.

methodstring

The HTTP method (GET, POST, PUT, DELETE, etc.).

headersstring

Optional headers to include in the request as a JSON string.

bodystringnull

Optional body for POST, PUT, or PATCH requests as a JSON string.

additionalRequestParamsstringnull

Optional additional request parameters as a JSON string.

Returns:
  • A promise that resolves to the response data or rejects with an error.
Type: 
Promise.<any>