Overriding functions to provide custom behavior
Code for the formula that Platform generates is divided into two sections as shown in the screen below.
You should not change any code in the second section, labeled Generated code for Corticon Service trigger. If you change request and/or response mappings, Platform regenerates this section of code.
The code in the first section contains function definitions that you can edit to customize processing and formatting. Platform does not regenerate this code when you change mappings.
The functions you can edit and what each can customize include:
processCorticonRequest()
— Edit this function to add post processing to the request before sending it to the Decision Service.processCorticonResponse()
— Edit this function to add post processing to the response before writing data to Platform records.formatDate()
— Converts Date fields from Platform to a standard format accepted by the Decision Service. Edit this function to change the format. The format needs to be supported by Corticon.formatDateTime()
— Converts DateTime fields from Platform to a standard format accepted by the Decision Service. Edit this function to change the format. The format needs to be supported by Corticon.formatPickListValue()
— Converts Picklist values from the Decision Service's response. Edit this function to customize the conversion.convertRequestData()
— Converts request data by type; callsformatDate()
andformatDateTime()
. Edit this function to add conversions for different data types.convertResponseData()
— Converts response data by type; callsformatPickListValue()
. Edit this function to add conversions for different data types. See Supported data types and conversions for information about supported data type formats and an example.compareCorticonObject()
— Compares the response to map a related Platform object. By default, Platform passes the related object's ID when sending a request to the data service. The data service returns the same ID when sending the response. Platform uses the ID to compare the related object and update its value. Edit this function to add more conditions in addition to the default behavior.