Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Each of the different types of Custom Logic: Custom Events, Custom API, and Custom Validation share these common syntaxes and available functions.

...

Code Block
languagephp
$contact_request = [
    "customer_number" => "ABC123",
    "last_name" => "Help",
    "first_name" => "PCR",
    "email" => "help@pcr.com",
    "email_directory" => 1,
    "phone_number" => "616-555-1212",
    "phone_primary" => 1,
    "phone_type" => 1234, // RECID from Lists
    "phone_directory" => 1,
    "status" => 1,
    "contact_directory" => 1,
    "contact_types" => "CUSTOMER",
];
$result_contact = $this->call("saveContact", $contact_request);
if($result_contact["status"] == "success") {
    $response["contact"] = $result_contact["data"];
}

Other allowed functions & syntax

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

Date/Time: date , time , mktime , strtotime , DateTime , DateInterval , add , sub, diff, format, setTimestamp , setTime , setDate

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

String: is_numericstrtolower , strtoupper , substr , stristr , strstr , stripos , strpos , strripos , strrpos , addslashes , chr , trim , ltrim , rtrim , str_replace , preg_matchpreg_replace , preg_splitstr_pad , sprintfsubstr_replace , strlen

Array: explode , implode , is_array , in_array , array_diff , array_diff_key, count

JSON: json_decode , json_encode

Debug: error_log

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


PHP Constants: Most PHP Constants are allowed.  Contact PCR if you find one that is not allowed, but would like to use. 

Include Page
Allowed Functions in Custom Logic
Allowed Functions in Custom Logic

Child pages (Children Display)
styleh6
sorttitle