Security restricted error while creating a widget through script

ankurkumar06412
Tera Contributor
Security restricted: Access to api 'put(pa_widgets.name)' from scope 'x_hcltu_hcl_flexsp' has been refused due to the api's cross-scope access policy. 
Security restricted: Create operation against 'pa_widgets' from scope 'x_hcltu_hcl_flexsp' has been refused due to the table's cross-scope access policy

I am trying to create a widget through the script , tried to test it out multiple time using script background but i am getting the above mentioned error all the time. I even created cross scope application policy and under Table in the Applications sub section , I checked the option "Accessible from all the scope" as well as "can create", "can read", "can delete", etc... options for pa_widgets as well as my custom table, still not resolved!

 

Please suggest..... 

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@ankurkumar06412 

but why to create widget from script?

seems it's a cross scope issue and you are not allowed to edit the name field from other scope

share your script here

Did you try to create restricted caller access record for this?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

var gr = new GlideRecord('pa_widgets');

gr.initialize();

gr.name = 'test'; //indicator name needs to be entered

gr.indicator = '102' //indicator id needs to be passed

gr.insert();