eminero
09/05/2024, 10:32 PMCeligo AI
09/05/2024, 10:32 PMAI 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:
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.Celigo AI
09/05/2024, 10:33 PMSlack 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
Celigo AI
09/05/2024, 10:33 PM