Are script records deletable by SuiteScript
# ask-stanley-ai
b
Are script records deletable by SuiteScript
c
AI generated answer (using internal Slack threads):
Based on the conversations provided, it appears that script records cannot be deleted using SuiteScript. An attempt to delete a script record using SuiteScript results in an error: RECORD_CANNOT_BE_CREATED_OR_DELETED. This is demonstrated in the following code snippet:
Copy code
javascript
/**
 * @NApiVersion 2.x
 * @NScriptType Suitelet
 * @NModuleScope Public
 */
define(['N/record'],function(record){
  function onRequest(){
    log.debug('delete script');
    record.delete({
      type:record.Type.SUITELET,
      id: 4
    });
    log.debug('deleted');
  };
  return {
    onRequest: onRequest
  };
});
The closest action you can take is to set the script record to inactive. However, it's important to note that this does not delete the record, it simply makes it inactive. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.871263206
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.860047758
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859489799
Please provide your feedback on this answer.