- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 08:13 AM
We are upgrading from Fuji to Istanbul.
A business rule within a scoped application (delivered by ServiceNow) sets a Date Completed value when a record is Closed.
This ran fine on Fuji but displays the error "Illegal access to method getDisplayValue() in class com.glide.glideobject.GlideDate." on Istanbul.
Error logs show:
java.lang.SecurityException: Illegal access to method getDisplayValue() in class com.glide.glideobject.GlideDate
Caused by error in <refname> at line 1
==> 1: GlideDate().getDisplayValue()
The business rules action is
Set field values [Date Completed] [To] [javascript: GlideDate().getDisplayValue()]
Is there a way I can make this allowed without changing the script?
If not, can someone suggest an alternate solution that would be allowed.
Solved! Go to Solution.
- Labels:
-
Upgrades and Patches
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 08:47 AM
Hi Bradley,
My bad, I didn't get that. Could you please try using the Script in the 'Advanced' tab. I believe the Business rule if of before type. Please remove the Set Field Values and use the script as below:
current.field_name_of_date_completed = new GlideDateTime().getDisplayValue();
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 08:23 AM
Hi Bradley,
Could you please provide the script of the same. Also it would be something like below,
var date = new GlideDateTime().getDisplayValue();
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 08:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 08:47 AM
Hi Bradley,
My bad, I didn't get that. Could you please try using the Script in the 'Advanced' tab. I believe the Business rule if of before type. Please remove the Set Field Values and use the script as below:
current.field_name_of_date_completed = new GlideDateTime().getDisplayValue();
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2017 09:03 AM
Amlan,
I thought that is what you might have meant and have since removed the action and created the following script in the business rule.
For some reason this isn't illegal? Problem solved. Will mark your answer correct.
function onBefore(current, previous) {
// Originally set date_completed in this Business rule's Action:
// Set field values [Date Completed] [To] [javascript: GlideDate().getDisplayValue()]
// That would create error's whe we upgraded to Istanbul
//
// This script achieves the same result and for some reason is not illegal.
//
// See INC0010831. 2017-06-14, brad.perkins
var date = new GlideDateTime();
current.date_completed = date.getDisplayValue();
}