Versions Compared

Key

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

...

The Custom API and Custom Events can invoke the Write methods for API types by using the call function. This function allows passing data from the Custom API or Events to the API logic.  When invoking this from the Custom API this feature allows you to reformat the incoming API data - perform data validation and lookup and then handoff the properly formatted data to write data.  When invoked from a Custom Event it allows scheduled or triggers events to update this data.

Code Block
languagephp
/*
$apiFunction Options: 
  saveService, saveServiceDesk, saveContact, saveCable, saveGla, saveEquipment, saveLocation,
  renderCustomReport, renderCableViewPath
*/

array $this->call ( string $method, array $bind_params); $params, bool $commitOnSuccess)
Parameters

$method The callable method name. The available callable methods: saveCable, saveContact, saveEquipment, saveGla, saveService, and saveServiceDesk

$params An array of key payload data that is passed to the other API calling function.

$commitOnSuccess A True/False value telling PCR-360 whether to save changes after a successful call or not. When True, if a call is successful, PCR-360 will commit the change. When not provided with a True, the function will assume False is desired, and if an error occurs down the line, any successful changes will be rolled back.

Return Values

The function returns a result array containing 'data' which specifies the outcome of the call. For a successful call to saveServiceDesk, this array contain the Service Desk item/action that was created.

...