- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2015 11:49 PM
I am trying to generate a unique Cart Id in a application scoped Script on Fuji Instance.
var cartId = GlideGuid.generate(null);
But I am getting following error:
Evaluator: java.lang.SecurityException: GlideGuid is not allowed in scoped applications
Caused by error in script at line 1
==> 1: var cartId = GlideGuid.generate(null);
The above line of code works well in global scoped script and I am able to generate a cart id.
How Can I access GlidGuid in application scoped sctipt?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2015 09:28 AM
Hi Arun,
You want to use gs.generateGUID():
gs.info(gs.generateGUID());
//output: x_snc_app: 87d2891f4fa0120087cdf9718110c7fb
Another alternative is to just create a new GlideRecord and get it's sys_id:
var myguid, anygr = new GlideRecord('incident');
anygr.initialize()
myguid = anygr.getUniqueValue();
Just don't save that GlideRecord.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2015 09:28 AM
Hi Arun,
You want to use gs.generateGUID():
gs.info(gs.generateGUID());
//output: x_snc_app: 87d2891f4fa0120087cdf9718110c7fb
Another alternative is to just create a new GlideRecord and get it's sys_id:
var myguid, anygr = new GlideRecord('incident');
anygr.initialize()
myguid = anygr.getUniqueValue();
Just don't save that GlideRecord.