Account expiry dates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2009 03:57 AM
Hello
We currently import our users from active directory to SNC via the LDAP plugin. I want to bring over the account expiry dates too but as this is stored in Integer8 format it will need some transform scripting to get it to show a human-readable date format.
I'm afraid I have no idea how to convert Integer* to the current date format. Can anyone offer help or guidance?
Thanks
Andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2014 03:52 PM
Strange! Do you have a personal timezone setting on the instance? Or is your profile running off the system timezone?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2014 06:34 PM
yes, timezone - Canada Eastern.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2015 05:34 AM
Hello all,
I just tried to implement this in our dev environment and i see the string coming across after the transform in the import set log (still in the format of 130748436000000000) but it isn't converting it and putting it into my u_account_expires on my sys_user table (blank fields).
I checked in my system logs and see warnings stating the following, any thoughts?
java.lang.SecurityException: Illegal attempt to access class 'com.glide.glideobject.GlideDateTime' via script
Caused by error in <refname> at line 10
7: // Only convert AD accountExpires values that begin with 1 (ex. 0 represents never expires)
8: if (s.charAt(0) == 1) {
9: var msDate = new Packages.org.apache.poi.hpsf.Util.filetimeToDate(n);
==> 10: var gDate = new Packages.com.glide.glideobject.GlideDateTime();
11: gDate.setValue(msDate);
12: target.u_account_expires = gDate;
13: gs.log('Setting the Account Expires date for ' + target.name + ' to ' + gDate);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2015 09:05 AM
I get the same issue...
java.lang.SecurityException: Illegal attempt to access class 'com.glide.glideobject.GlideDateTime' via script
Caused by error in Transform Script: 'onBefore' at line 10
7: // Only convert AD accountExpires values that begin with 1 (ex. 0 represents never expires)
8: if (s.charAt(0) == 1) {
9: var msDate = new Packages.org.apache.poi.hpsf.Util.filetimeToDate(n);
==> 10: var gDate = new Packages.com.glide.glideobject.GlideDateTime();
11: gDate.setValue(msDate);
12: target.u_accountexpires = gDate;
13: gs.log('Setting the Account Expires date for ' + target.name + ' to ' + gDate);
I did see another post whereby it referenced creating a script include to do soem of the conversion that was called by the transform script... would this help?
Any ideas...?
Surely this has to be something simple as loads of people must want this functionality??? I'm sure someone has it working somewhere...?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 12:26 PM
The fix for me was to replace:
var gDate = new Packages.com.glide.glideobject.GlideDateTime();
with:
var gDate = new GlideDateTime();
Explanation: Packages Call Replacement Script Objects - ServiceNow Wiki