Topic by csmith
Content
I am trying to create an incident with a "Root Cause" which I think is the Disposition field, I have the following Code:
-------------------------------------------------------------
use RightNow\Connect\v1_1 as RNCPHP;
require_once( get_cfg_var("doc_root")."/ConnectPHP/Connect_init.php" );
$incident = new RNCPHP\Incident();
$meta = RNCPHP\Incident::getMetadata();
$incident->Subject = "SaaS System Down";
$queryResult = RNCPHP\ROQL::queryObject("SELECT Contact FROM Contact WHERE id=".$this->session->getProfileData('c_id'))->next();
$incident->PrimaryContact = $queryResult->next();
$incident->CustomFields->priority = 193; //S1-Mission Critical
$incident->CustomFields->issue_type = 37; //Technical
$incident->Queue->ID = 14; //Technical Services - Urgent
$incident->Disposition->ID = 1486; //SaaS Admin
$incident->Threads = new RNCPHP\ThreadArray();
$incident->Threads[0] = new RNCPHP\Thread();
$incident->Threads[0]->EntryType = new RNCPHP\NamedIDOptList();
$incident->Threads[0]->EntryType->ID = 3; // Used the ID here. See the Thread object for definition
$incident->Threads[0]->Text = "Sample.";
$incident->save();
---------------------------------------------------------------
When it executes I get:
Fatal error: Uncaught exception 'RightNow\Connect\v1_1\ConnectAPIError' with message 'Not Allowed: read-only: ServiceDisposition.ID'
Now I have found that I can successfully create an Incident by doing the following: