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

Including library from CP in CPM

Accepted answer
21
Views
6
Comments
edited Jul 26, 2018 5:33PM in Agent Desktop 6 comments

Content

Using example CPMs I found here on the community I pieced together a simple CPM that I wish to have call a library stored in our CP. The library appears to be included, but I may be calling the function contained in that class incorrectly. I'd appreciate any advice on how to accomplish this! Code is below.

Thanks! 

Version

Feb 2017

Code Snippet

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

const DEV_MODE = false;
define('APPPATH',
        DEV_MODE ?
                __DIR__ . "/scripts/cp/customer/development/" :
                __DIR__ . "/scripts/cp/generated/production/optimized/");


class inctest implements RNCPM\ObjectEventHandler {
   
  public static function apply($run_mode, $action, $obj, $n_cycles) {     
    require_once(APPPATH . "libraries/Sample.php");
    //

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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