Anyone know if it's possible to delete a script re...
# suitescript
d
Anyone know if it's possible to delete a script record with suitescript? I need to do this in an install script and it says I cannot create/delete this record type.
s
I've seen that if the script scope was limited to a bundle that I didn't own.
Do you have any deployments associated with it?
d
I can delete the deployment. And my tests were on a script that wasn't in a bundle (I think - maybe I'll try again).
Tried again just to make sure: RECORD_CANNOT_BE_CREATED_OR_DELETED
Copy code
/**
 * @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
  };
});
s
weird... I guess the closest you can get is to set it to inactive?
d
*not to self, try reading the documentation once and a while... haha
s
noted!
once while reading the manual I found a great text formatting function that NetSuite developed for FreeMarker.. handles all kinds of issues.. how many times did I write a formatcurrency function ... -- lol