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

Read/pickup the desktop file push to incident of service cloud

Accepted answer
12
Views
22
Comments
edited Jun 8, 2022 11:55AM in General Technical Discussions 22 comments

Content

Hi,

I am trying Read/pickup the desktop file push to incident of service cloud using Connect PHP API.

but  i am getting  empty result and am using the below code

please help me this issue

Version

Service Cloud

Code Snippet

             <?php

/**
 * CPMObjectEventHandler: fileattachement
 * Package: RN
 * Objects: Incident
 * Actions: Create
 * Version: 1.2
 * Purpose: create a Incident in Salescloud
 */
 
use \RightNow\Connect\v1_2 as RNCPHP;
use \RightNow\CPM\v1 as RNCPM;

class fileattachement implements RNCPM\ObjectEventHandler
{
    public static function apply($runMode, $action, $incident, $cycle)
    {
        if ($cycle !== 0) return;
        //ob_start();
		
 
$myFile = "JRRTEST.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;

//echo fread($myfile,filesize("test.txt"));
//fclose($myfile);
//echo $myfile;
$msg = ob_get_contents();			
			ob_end_clean();
			
			$f = fopen('/vhosts/asaelectronics/euf/assets/CPM/log.txt','a');
   

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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