Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Julie F
    Write data from Custom Object field to Contact custom field
    Topic posted October 7, 2019 by Julie FBronze Crown: 15,000+ Points, tagged Connect PHP, Custom Process Models - CPMs, REST 
    19 Views, 1 Comment
    Title:
    Write data from Custom Object field to Contact custom field
    Summary:
    Does anyone have an example of the above?
    Content:

    I have a custom object group. Lets call it GroupObject. It has a number of objects within it. Lets call those.CObject1, CObject2 etc.and they each have fields.

    In a CPM I want to write GroupObject.CObject1.time (time is one of the fields, it is not the current time) to:

    contact_data->CustomFields->c->last_saved    a contact record custom field called last_saved.

    Any example, for any part of this, would be greatly appreciated.

    Comment

     

    • Julie F

      An extract something along the lines of:

       

      // Get the correct custom object
      static::$Courses   = RNCPHP\myCourses::Fetch($obj->ID);
       
      // Get the correct contact object
      static::$contactObj->ID = RNCPHP\myCourses::Fetch($obj->Courses.course1->ID);
       
      // Update the custom field and save the record
      $contact->wbs_last_saved = RNCPHP\myCourses\Course1::fetch($obj->CustomFields->CO-> course1->time);
      echo $time;
       
      $contact->save();