Hi All,
I have created a Suitelet which allows the user to specify a 'Quarter' (Q1,Q2,Q3,Q4) prior to submitting the Suitelet. Depending on the users selected value a different deployment id is supplied to the nlapiScheduleScript operation - each have a different schedule, e.g. Q1 is a yearly event on January 15 and 1am, Q2 is a yearly event on April 15 at 1am etc.
However, having clicked submit when nlapiScheduleScript is called, the scheduled script executes immediately rather than waiting until the date set by the deployment id. Is there any way in which this can be resolved?
Below is an example of the code used:
var userSelectedQuarterValue = request.getParameter('custpage_select_reporting_quarter');
switch(userSelectedQuarterValue)
{
case "1":
// activate relevant scheduled script deployment
status = nlapiScheduleScript('customscript_ss_generate_sales_reports', 'customdeploy_sales_report_deploy_q1', params);
nlapiLogExecution('DEBUG', 'Status: ', status);
break;
case "2":
status = nlapiScheduleScript('customscript_ss_generate_sales_reports', 'customdeploy_sales_report_deploy_q2', params);
nlapiLogExecution('DEBUG', 'Status: ', status);
break;
case "3":
status = nlapiScheduleScript('customscript_ss_generate_sales_reports', 'customdeploy_sales_report_deploy_q3', params);
nlapiLogExecution('DEBUG', 'Status: ', status);
break;
case "4":
status = nlapiScheduleScript('customscript_ss_generate_sales_reports', 'customdeploy_sales_report_deploy_q4', params);
nlapiLogExecution('DEBUG', 'Status: ', status);
break;
default:
break;
}
Any assistance would be great,
Thanks,
Jordan