HomeDeveloperClassdefault_init

default_init

This function is defined by system. It is must to have this function in class. It is called by system when we invoke class from proess builder and any other way. It is used to pass property from system to class which can be used in class. Below are the variables passed to function from process builder:

  1. $data_array : All defined properties in process builder are passed in class by this array. Properties can be invoked by $data_array[‘property_name’]
  2. $data_array[“object_unique_id”] : It is system defined reserved variable. User can not use this variable. It is used to pass Unique_Id of current invoked Object.
  3. $data_array[“record_id”] : It is system defined reserved variable. User can not use this variable. It is used to pass record_id of current invoked record.


//This is the necessary function
public function default_init($data_array)
{
$this->record_id = $data_array[“record_id”];
$this->object_unique_id = $data_array[“object_unique_id”];
$this->record_array = $data_array;
}

Was this article helpful to you? Yes No