I'm creating script deployments of a Map Reduce vi...
# ask-stanley-ai
e
I'm creating script deployments of a Map Reduce via code, I'm able to create the deployments but I'm not able to set the frequency, start date, by default it always gets created as a single event. Is there a way to set the daily, weekly, monthly frequency?
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** Based on the conversations, it appears that scheduling script deployments in NetSuite via SuiteScript is not directly supported. The scheduling of script deployments, including setting the frequency and start date/time, is typically done manually through the NetSuite UI. However, you can set the status of a script deployment to 'SCHEDULED' using SuiteScript, as shown in the provided code snippet:
Copy code
javascript
var record2= nlapiLoadRecord('scriptdeployment', id, {recordmode: 'dynamic'});
record2.setFieldValue('status' , 'SCHEDULED');
record2.setFieldValue('startdate' , new Date());
record2.setFieldValue('starttime' , 1100);
nlapiSubmitRecord(record2,true);
But, it's important to note that this code does not actually schedule the script deployment. It only sets the status of the script deployment to 'SCHEDULED'. The actual scheduling (i.e., setting the frequency and start date/time) still needs to be done manually through the NetSuite UI. For scheduling a script to run on specific days of the week (e.g., Monday to Thursday), you would need to create separate deployments for each day and set them to run weekly. Alternatively, you could add logic within your script to exit execution if the current day is not one of the desired days.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843053699
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842289
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842052519
Please provide your feedback on this answer.