- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 09:16 PM
In my server side code, I want to determine if a field is typeof phone number, then do formatting on it. The best I've come up with is:
gr.getElement('phone').getED().internalType =='ph_phone'
but this seems really kludgy. Is there any exposed API that will do what I'm looking for? so far I haven't found any...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 01:53 AM
That's the way I know it as well and that' show it's documented as well:
https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/GlideElement_global/concept/c_GlideElementAPI.html#ariaid-title19
See example in the documentation:
var fields = current.getFields(); for (i=0; i<fields.size(); i++) { var field = fields.get(i); var descriptor = field.getED(); gs.print("type=" + descriptor.getType() + " internalType=" + descriptor.getInternalType()); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 01:53 AM
That's the way I know it as well and that' show it's documented as well:
https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/GlideElement_global/concept/c_GlideElementAPI.html#ariaid-title19
See example in the documentation:
var fields = current.getFields(); for (i=0; i<fields.size(); i++) { var field = fields.get(i); var descriptor = field.getED(); gs.print("type=" + descriptor.getType() + " internalType=" + descriptor.getInternalType()); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 04:29 PM
Thanks, was hoping there'd be a better way. Kinda lame if you have to look it up each time what each field type translates to