
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 01:23 AM
Hi Experts,
I'm currently shifting some develeopements (that worked) into a scoped app ... now I fave the issue, that I get en error message, telling me: "Error Message - Function setNewGuid is not allowed in scope xxx".
It's an UI action that urgently requires to generate a new sys_id within the underlying script ... but why does this not work within a scoped app?? What else could be used instead?
The UI action will create an record (that is in global) scope ... not sure if this is the issue?
Code like ... var record_id = newRec.setNewGuid();
Thank you!!!
Solved! Go to Solution.
- Labels:
-
Scoped App Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2024 05:44 AM
yes this randomly creates a sys_id that I then could set ... ok. Would mostpropbably work as workaround. I do update within the catalog task activity, then the sys_id can also be retrieved.
But thanks anyhow!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 01:33 AM
Hi,
In scoped app use this method and it should work
setNewGuidValue(String guid)
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
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-11-2018 01:37 AM
thank you.
But as far I understand this is to set a specific guid!?! ... I just need to store the guid of the record to be created via the script before the record is really actually inserted ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2018 01:53 AM
Hi,
Basically what I mean to say is that setNewGuid() works in global scope and setNewGuidValue(String guid) works in scoped application.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
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-12-2018 03:38 AM
Hi Vemffm,
Any update on this?
Can you mark answer as correct, helpful and hit like if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader