You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Two post_incident_create hooks use

Received Response
27
Views
9
Comments
edited Aug 29, 2017 11:58AM in Customer Portal 9 comments

Content

Hi All.

We need to add a contact custom menu field in ask page. So, we created a incident custom menu field, displayed it on as page. In hooks, we created post_incident_create hook and used it to update value of incident custom field in contact custom field. Please check our function below which is being called in hook. 

function hookfn($hookdata)
    
    {
    $incid = $hookdata['data']->ID;  //Incident ID Submitted
        $incobj = RNCPHP\Incident::fetch($incid);
        $contobj = $incobj->PrimaryContact;
        
        $incval = $incobj->CustomFields->c->office_location->LookupName;
        
        $contobj->CustomFields->c->office_location = new RNCPHP\NamedIDLabel();
        $contobj->CustomFields->c->office_location->LookupName = $incval;

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!