Document toolboxDocument toolbox

(2024.2) Allowed Functions in Custom Logic

Allowed Functions

Array

explode , implode , is_array , in_array , array_diff , array_diff_keycount

JSON

json_decode , json_encode

cURL

curl_init , curl_setopt , curl_exec , curl_errno , curl_error , curl_getinfo , curl_close , http_build_query

Date/Time

date , time , mktime , strtotime , DateTime , DateInterval , add , sub, diff, format , setTimestamp , setTime , setDate

Debug

error_log, debug

Debug Function
$this->debug();

Note: The debug command outputs to a cache which is then displayed in the Debug tab/grid for the Custom Logic you are debugging.

Logical

if , elseif , else , switch , case , default , break , for , foreach , as , while , do-while , return , new

Mathematical

round , trunc ,ceil , floor , rand , srand , pow , exp , abs , max , min , bindec , hexdec , octdec , base_convert

PCR-360 Data

call , query , listGetByCode , listFindValue , listFindCode

Call Function
// $apiFunction Examples: saveService, saveServiceDesk, saveContact, saveCable, saveGla, saveEquipment, etc. $this->call(string $apiFunctionToCall, array $params)



Query Function
array $this->query ( string $sql, array $bind_parameters );



listGetByCode Function



listFindValue Function



listFindCode Function

String

is_numeric , strtolower , strtoupper , substr , stristr , strstr , stripos , strpos , strripos , strrpos , addslashes , chr , trim , ltrim , rtrim , str_replace , preg_match , preg_replace , preg_splitstr_pad , sprintf , substr_replace , strlen

Additional Functions

Contact PCR if you find a function that is not allowed, but would like to use. 

Validation functions

setError

Sets a validation error message. This messages output in the UI if the validation logic returns false. If this function is called multiple times, only the message from the last calls is displayed.

setError Function

setWarning

Sets the validation warning message. This messages output in the UI only if the logic does not return false. If this function is called multiple times, only the message from the last calls is displayed.

setWarning Function

Triggering Events

PCR_Event, trigger, attach, attachDb

In this example the GLA Replace Event is triggered with specific parameters. For detailed information on which Events can be triggered, and how to trigger those Events, please navigate to the Triggerable Events List page.

PCR_Event Functions