Example customization
The example below shows how to override the
processCorticonRequest()
and
processCorticonResponse()
functions to saves the request, the
response, the duration, and the timestamp in fields in an Order
record:
function processCorticonRequest ( requestData ) { /* Add post processing to the Corticon request before making REST call - by default we leave it untouched. */ rbv_api.setFieldValue('Order', '{!id}', 'decisionServiceRequest', rbv_api.jsonToString(requestData)); return requestData; } function processCorticonResponse ( corticonResponseString, corticonResponseObject, requestDuration, requestDateTime ) { /* Add post processing to the Corticon response before writing fields and objects in Platform - by default we leave it untouched. */ rbv_api.setFieldValue('Order', '{!id}', 'decisionServiceResponse', corticonResponseString); rbv_api.setFieldValue('Order', '{!id}', 'decisionServiceDuration', requestDuration); rbv_api.setFieldValue('Order', '{!id}', 'decisionServiceTimestamp', requestDateTime); return corticonResponseObject; }
The View page for Order includes a page tab that displays this information: