hey everyone! I have a task based on the recommend...
# suitescript
m
hey everyone! I have a task based on the recommendations of a NetSuite performance audit to update all SuiteScripts to a log level of ERROR (we have a ton of Avalara, Celigo, etc scripts left in DEBUG). I am running a Saved Search to use each Script Deployment ID (data.id) for any Script Deployment Record not already set to Error, in this code:
record.submitFields({
type: record.Type.SCRIPT_DEPLOYMENT,
id: data.id,
values : {
loglevel : 'ERROR'
}
});
This gives me an error of:
"code":"USER_ERROR","details":"Please enter value(s) for: Role ID"
I am guessing this is because most of these scripts are set to Current Role for the Execute As Role field? I have had the above record.submitFields() call work when hard-coding in an id of a script I wrote with a different Execute As Role field value. Anyone have any ideas about this? Will it even be possible to mass update these scripts if the Role is Current Role? Thanks!
a
@MR from error it seems for those deployment Role ID is mandatory
m
the Role ID, assuming it means Execute As Role, isn't empty. It has a value: Current Role. But it seems to throw that error whenever the value is Current Role. I was going to look into adding it to my saved search as a filter, at least to help narrow this down, but it doesn't look like the Execute As Role field can be set as a column based on this: https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/scriptdeployment.html
s
Try adding
ignoreMandatoryFields
to your
submitFields
call
m
@Sandii Thanks, I tried it, but same error
s
I would look at the Roles list in the Audience tab, i wonder if you have a role selected in there that has since been marked as inactive? Also maybe a try catch to log with roles are giving this error and allow the rest to continue. Thus narrowing down the trouble spots?