Honored Contributor.. Honored Contributor..
Honored Contributor..

Create Report Schedulers by Script.

Hi Experts. 

I want to create a report schedule by script. The reason for this is that we send out monthly reports to a lot of customers and they contain the same reports (based on which customer of course). 

When I do create a schedule - the issue is that i want it to run on a monthly basis, but for some reason it always gives me day when I create it by script. 

Anyone who has accomplished this? 

Current script: 




function createSchedule(reciever) {

var schFile = new SCFile("reportscheduleDefinition");

schFile["active"] = true;
schFile["current.phase"] = "planning";
schFile["email.subject "] = reciever + " Monthly Reports";
schFile["email.to.users"][0] = reciever;
schFile["file.type.pdf"] = false;
schFile["file.type.html "] = true;
schFile["flag.email"] = true;
schFile["flag.file"] = false;
schFile["name"] = reciever + " Monthly Reports";
schFile["page.direction "] = "portrait";
schFile["record.active"] = true;
schFile["rule.arbitrary"] = false;
/chFile["rule.day"] = 2;
schFile["rule.month"] = 1;
schFile["rule.month.type"] = "1";
schFile["rule.occurrence"] = 1;
schFile["rule.type"] = "month";
schFile["rule.timezone"] = "Europe/Middle";
schFile["rule.valid.type"] = "never";
schFile["rule.valid.from"] = system.functions.tod();
schFile["rule.start.time"] = "04:00:00";
schFile["approval.status"] = "approved";
schFile["rule.year.type"] = "regular";

var arr = new Array();
arr[0] = "5129";
schFile["inbox.report"][0] = 5129;

var rc = schFile.doAction("add");

0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.