How to get record type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2015 10:38 AM
Hi. I recently wrote a snippet of server-side Javascript to test for a specific record type by doing something like this:
if (current.aPropertyDefinedInMyExtensionTable) { ... }
While it works for my purposes I got to wondering if there's a better (or more canonical) ServiceNow approach to doing this? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2015 11:07 AM
Garry,
Can you tell what exactly you want to check? There might be some inbuilt function for this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2015 11:20 AM
current.sys_class_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2015 08:31 PM
Garry,
Try
current.getTableName()
For cmdb_ci the value is carried in a field. That's when you can use current.sys_class_name
hope this helps
Sandy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-17-2015 10:42 PM
I would look at the TableUtils methods, there is a lot of information you can get about a table with these methods.
