rbf_invokeCustomMethod()

Purpose

Platform client-side API to provide end-users the ability to invoke custom methods defined by the user on the same instance from a logged in UI session.

Note: This API is available only in New UI pages.

Syntax

rbf_invokeCustomMethod(customMethod, httpMethod, headers, params, body, options)
	

Parameters

customMethod

The endpoint of the custom method . This function argument is mandatory. See Custom Methods for more information on custom methods.

httpMethod

The HTTP method. This function argument is mandatory. The POST, GET, PUT, and DELETE HTTP Methods are supported.

headers

The JSON object with key-value pairs to be forwarded as HTTP Request headers.

params

The JSON object with key-value pairs, wherein, each entry denotes HTTP Request parameter name and parameter value.

body

The request payload as serialized string literal.

options

The JSON object with additional optional arguments as properties.

Property NameDescription
timeoutThis property configures AJAX call timeout in milliseconds. The default value is 5 minutes. However, this can be configured to a maximum of 15 minutes using this property. On exceeding this period, AJAX call will timeout and result in a timeout error response.
callbackCallback function handler. This API has asynchronous behavior. The service response is passed as an JSON object (function argument) to this callback function. This JSON object encapsulates the response status code, headers, and payload.
errorCallbackThe error details will be passed as arguments to this error callback handler. If this callback handler is not configured, use the global error handler function 'rbv_errorsCallback'.

Note: This API is supported in portals as well.

Example

var data = JSON.stringify({

"Student_name": "customrecord",

"subject_1": 5,

"subject_2": 24,

"subject_3": 70,

"Std_email": "test@yopmail.com"

});

rbf_invokeCustomMethod("student","POST",{"Content-Type":"application/json"},{"rollno":"1021"},data,

{ timeout:5000,

callback:function(resp) { console.log(resp);},

errorCallback:function(resp) { console.log("ERROR--->"+resp.message);}

});