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

Associate a contact to opportunity Oracle Sales Cloud object

Received Response
5
Views
1
Comments
edited Aug 10, 2017 4:36AM in Integrations and APIs 1 comment

Content

Hi,

I am having this problem. I am creating an integration using the Oracle Sales Cloud REST Api and the Oracle Right Now object process model event handler. In the code bellow I create a Opportunity object in Oracle Sales Cloud. But I cant find the way to associate the Contact in Oracle Sales Cloud.

Thanks

Code Snippet

             <?php

/*
* CPMObjectEventHandler: on_opportunity_create
* Package: RN
* Objects: Opportunity
* Actions: Create, Update
* Version: 1.2
*/

use \RightNow\Connect\v1_2 as RNCPHP;
use \RightNow\CPM\v1 as RNCPM;
use RightNow\Connect\v1_2\Audit as RNCPHP_Audit;

class on_opportunity_create implements RNCPM\ObjectEventHandler
{

  public static function apply( $run_mode, $action, $obj, $n_cycles)
    {
		if ($n_cycles !== 0) return;
		try
		{
		$service_url = 'https://cbwt-test.crm.us2.oraclecloud.com:443/salesApi/resources/latest/opportunities';
		   load_curl();
		   $curl = curl_init($service_url);
		  //
		  $curl_post_data  = json_encode(array("Name" => $obj->Name,  
												"EffectiveDate" => "2017-10-10",
												));
		curl_setopt($curl, CURLOPT_HTTPHEADER, array(
												'Content-Type: application/vnd.oracle.adf.resourceitem+json',
												'Expect: '
												)); 
		   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
		   curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
		   curl_setopt($curl, CURLOPT_POST, 1);
		   curl_setopt($curl,

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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