Security restricted error while creating a widget through script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2025 10:37 PM
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.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2025 11:30 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 07:13 AM
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();