- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2014 07:35 AM
If I put "javascript:current.sys_id;" in "Default value" field for an dictionary, it doesn't return anything when trying to create a new record… but if I put "typeof current" it does return "object", and "javascript:current.getTableName();" does work too. Any idea why?
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2014 07:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2014 07:45 AM
Because the record has no sys_id until it is saved in the DB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2014 07:55 AM
I haven't check, but I guess all the GlideRecord methods work at this time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2014 07:58 AM
The methods work but you are trying to get a value of a field which does not have a value yet.
You can check for that also using 'current.isNewRecord()' => https://wiki.servicenow.com/index.php?title=GlideRecord#isNewRecord