
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 06:34 AM
I have a copy of a UI action in my new scoped application that uses the function 'instanceOf'. It works fine in the global scope, but not inside the scope. It's in my condition statement, and I'm wondering if there is a scoped alternative for it. Here's the condition statement:
current.canCreate() && (!current.instanceOf('task') || gs.getProperty('glide.ui.task.insert') == 'true') && (!current.instanceOf('sys_db_object')) && !current.x_elar_metrix_ela_record ==''
Any help is greatly appreciated.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 06:48 AM
Hi Stephen,
I think you should be able to use current.sys_class_name != 'task' instead of instanceOf within a scoped application.
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 06:48 AM
Hi Stephen,
I think you should be able to use current.sys_class_name != 'task' instead of instanceOf within a scoped application.
Eric

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 07:40 AM
Thanx, that did it. I ran into another one.
I have a business rule inside the scope that translates a duration value to an integer, but the 'getGlideObject()' function isn't available inside the application scope. I've tried 'getDisplayValue()' and 'getValue()' but neither return.
Here's how I'm using it:
var scheduledDuration = current.u_scheduled_downtime.getGlideObject().getNumericValue();
var scheduledDurationMinutes = (scheduledDuration/1000/60);
current.u_minutes_downtime = scheduledDurationMinutes.toFixed();
current.update();
Any ideas on a replacement function inside app scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 08:15 AM
Hey Stephen,
Unfortunately, the only way I've found you can run 'getGlideObject()' on a scoped application record is through a Rest API call into the current table and creating a response call that allows you to run a script that contains 'getGlideObject() to get a numericValue and convert it into a schedule duration. Have you tried .getNumericValue() without the getGlideObject?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-14-2017 08:48 AM
I have tried 'getNumericValue()' directly on the field, but it doesn't return a value. Just shooting in the dark, I tried 'dateNumericValue()' and it worked! Here's the end result code:
var actualDuration = current.u_actual_downtime.dateNumericValue();
var actualDurationMinutes = (actualDuration/1000/60);
current.u_minutes_downtime = actualDurationMinutes.toFixed();
current.update();