Mike Casey
02/24/2025, 8:07 PMCeligo AI
02/24/2025, 8:07 PMAI generated answer (using internal Slack threads):To execute a script as an administrator for scripts that are used on form buttons, you would need to use a Suitelet. Client scripts run on the client side and therefore run with the permissions of the current user. However, Suitelets run on the server side and can be set to run as an administrator. Here are the steps you can follow: 1. Create a Suitelet that performs the desired action. Set this Suitelet to execute as role: admin. This will allow the Suitelet to run with administrator permissions. 2. In your client script that is triggered by the form button, make a call to the Suitelet. You can do this using the
https
module's get
or post
methods.
Here is a basic example of how you can call a Suitelet from a client script:
javascript
var url = url.resolveScript({
scriptId: 'customscript_my_suitelet',
deploymentId: 'customdeploy_my_suitelet',
returnExternalUrl: true
});
var response = https.get({
url: url
});
In this example, replace 'customscript_my_suitelet'
and 'customdeploy_my_suitelet'
with the script ID and deployment ID of your Suitelet.
Remember, the Suitelet must be deployed and available to be called from the client script.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
02/24/2025, 8:07 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835222
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833024442
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823835075
Celigo AI
02/24/2025, 8:07 PM