I have a bundle with multiple locked SuiteScripts....
# ask-stanley-ai
s
I have a bundle with multiple locked SuiteScripts. The user who downloaded the bundle and is the owner of the suitescripts is no longer here. How can I change the owner of this locked suitescript, or change who the unhandled errors go to?
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. ****** To change the owner of a locked SuiteScript that came from a bundle, you can load the script record using SuiteScript's
N/record
module and then change the owner. Here's a simplified example of how you might do this:
Copy code
javascript
var scriptRecord = record.load({
    type: record.Type.SCRIPT,
    id: 'customscript_my_script_id'
});

scriptRecord.setValue({
    fieldId: 'owner',
    value: 'new_owner_internal_id'
});

var scriptId = scriptRecord.save();
Please replace
'customscript_my_script_id'
with the ID of the script you want to change the owner of, and
'new_owner_internal_id'
with the internal ID of the new owner. Please note that this change might be overwritten if the bundle is updated. Also, be aware that this method might not work if the script is locked in a way that prevents any changes, even via SuiteScript. As for changing who the unhandled errors go to, unfortunately, if the scripts are locked, you can't change the setting for who gets notified for unhandled errors. The notifications will continue to be sent to the original owner of the scripts.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858179629
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837806523
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835645616
Please provide your feedback on this answer.