Issue with Retrieving Previous value.
Content
Hi Team,
We have a custom PHP that sends out a mail when severity of an incident is changed. When we try compiling the code , we are unable to retrieve the previous value of the severity to compare it with the current severity value.
We are executing the CPM synchronously.
Error Thrown : Line 31 : Trying to get property of a non object
Version
Service cloudCode Snippet
<? /* * CPMObjectEventHandler: mailonseveritychange_syn * Package: RN * Objects: Incident * Actions: Update * Version: 1.2 */ use \RightNow\Connect\v1_2 as RNCPHP; use \RightNow\CPM\v1 as RNCPM; class mailonseveritychange_syn implements RNCPM\ObjectEventHandler { public static function apply( $run_mode, $action, $incident, $cycle ) { if ($cycle !== 0) return; if (RNCPM\ActionUpdate == $action) { $incidentId=$incident->ID; $Severity = RNCPHP\ROQL::query("select severity.lookupname from incident where id=$incidentId;" )->next(); $SeverityLookupname=$Severity->next();
2