Help! I'm getting the following error because the ...
# suitescript
d
Help! I'm getting the following error because the script cannot be run as administrator but I don't know how to fix it. The role already has FULL for all entity types. I'm getting this error when trying to add the record to a render for an email.
Copy code
{
   type: "error.SuiteScriptError",
   name: "INSUFFICIENT_PERMISSION",
   message: "For security reasons, only an administrator is allowed to edit an administrator record.",
   stack: [
a
Which script type is trowing that error?
d
restlet
a
Restlets behave differently when you select All Roles or All Employees or both(in the Audience tab)…the different way they behave is documented in the help.
d
The restlet has to use the role assigned to the token
a
Read again ^ restlet permissions are affected by the role and also by what you selected in the deployment audience tab.
If you gave the needed permissions to the role and you are still having permission issues, then your problem is most likely to be related to that audience tab behavior.
d
not true, the restlet is forced to use the role assigned/used by the token
the audience has nothing to do with this
This is when used externally. Internally, this may be true.
a
It is for Suitelets, my bad... good luck
Are you using any method with .promise server side in your restslet?
d
no, promise is client side
a
You can use server side promises in 2.1
However there is a bug in promises server side not respecting the role that invoke them.
z
Read carefully the response : Only administrator... The reason for error is you are trying to edit the EMPLOYEE record of an administrator, but you are updating as non-administrator role. I have the same issue :Third party HR software use SOAP for integration and when administrator record should be updated, NetSuite rejects SOAP request...