
- 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-12-2018 06:50 AM
The question was how to use setNewGuid() or something similar in scoped app ... not how to set a specific guid in scoped app ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 08:10 AM
Hi Ankur, sorry for not replying some years ago .. I can remember that I chose to use an other approach and forgot about this post. Now again having the same issue and workaround not working properly. Need to get the ID within a SCOPED workflow activity (SC TASK) .... . setNewGuidValue(String guid) will not work as I need a generic solution getting the sc_task sys_id .. makes no sense to set the sys_id myself. setNewGuid() works fine when global .. but there need to be a solution to do the same within scoped application. Any idea? Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 02:48 AM
Hi, you can use this function in a scoped application:
var newSysId = gs.generateGUID();
For example such a UI Action
would lead to this result:

- 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
02-19-2024 02:25 AM
Hi, in a Scoped App you can make use of the return value of the insert() method.
So you can replace
var newSysId = current.setNewGuid();
current.insert();
with
var newSysId = current.insert();
to get the same result.