- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 08:26 AM
Is there a gs equivalent to the g_form.isNewRecord() ?
I find this very useful in client scripts, but sometimes, I see myself wanted to use this in UI Actions that are not client-based as well...
Solved! Go to Solution.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 11:12 AM
current.isValidRecord() is what you're looking for. This SNGuru article explains the usage of both...
http://www.servicenowguru.com/scripting/client-scripts-scripting/testing-valid-record/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 08:31 AM
I'm not sure there is a GlideSystem equivalent of g_form.isNewRecord(). However there is a GlideRecord function identical to it isNewRecord(). It sees whether or not the record has been inserted into the DB yet. I believe it is usable with the 'current' variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 09:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 11:12 AM
current.isValidRecord() is what you're looking for. This SNGuru article explains the usage of both...
http://www.servicenowguru.com/scripting/client-scripts-scripting/testing-valid-record/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 11:19 AM
I see the difference between the 2 calls now:
current.isNewRecord() returns true only if the newRecord() method has been called.
current.isValidRecord() returns true if table is valid or if record was successfully fetched, or false if table is invalid or record was not successfully fetched.