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
Note!! Please register for a free account to access the full content and also to participate in Q&A in the community

Initilisation script not running

edited Jul 17, 2018 9:45AM in Reporting & Analytics for B2C Service 2 comments

Content

Hi,

Using the code snippet below in the custom script editor of a report, under the initilisation tab, the code doesn't seem to run. Any ideas why?

We have several reports like this and I can't see to debug what is happening

It runs fine on the CP. How would I go about debugging this?

Code Snippet

             require_once(get_cfg_var('doc_root')."/ConnectPHP/Connect_init.php");
use RightNow\Connect\v1_3 as RNCPHP;
initConnectAPI();

for ($z = 0; $z <= 100; $z++) {
    $query_string = "SELECT Misc.incident_stats FROM Misc.incident_stats LIMIT 10000";
    $destroy = RNCPHP\ROQL::queryObject($query_string)-> next();
    while($destroyEverything = $destroy->next()){
        $destroyEverything->destroy();
    }
} 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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