How to access classes in scoped applications?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2016 08:42 AM
Hi guys I am trying to access to GlideRecordUtil from a business rule within an application(scoped application that I am developing), the problem is that I get this message in the form where I am applying the business rule:
I really need to use GlideRecordUtil, is there any way to achieve this? just to give you a little bit of background I am trying to record all fields that changes in the form from the server side!, any idea how to fix the GlideRecordUtil issue or maybe another alternative?
************Ignore that the application picker says Global, it said global just because for a moment I changed the application picker to global to make some testings using the same script in another Business rule in global scope and by the way IT WORKED!!!!********* so I dont think it is a script issue.***********
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2016 09:58 AM
Hi,
To make a call for the global scripts includes from a scoped application, you need to use global name space before initiating them. so you have initiate like:
var gr = new global.GlideRecordUtil();
and make sure that GlideRecordUtil is accessible from all applications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2016 11:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-15-2016 11:33 AM
Hello Rahuljain! if the script goes like this where should I place the "global word",
if (typeof GlideScriptRecordUtil != 'undefined'){
var gru = GlideScriptRecordUtil.get(current);
}
else{
var gru = Packages.com.glide.script.GlideRecordUtil.get(current);
}
var changedFields = gru.getChangedFields(); //Get changed fields with friendly names
var changedValues = gru.getChanges(); //Get changed field values
//Convert to JavaScript Arrays
gs.include('j2js');
changedFields = j2js(changedFields);
changedValues = j2js(changedValues);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 10:55 PM
Hi,
Did you get a solution to this?