GlideElement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 07:26 AM
Hi Guys,
Can anyone tell me the difference between gr.getValue(FIELDNAME); and gr.FIELDNAME;?/
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 07:41 AM
Hi Saran,
Please read this wiki link...http://wiki.servicenow.com/index.php?title=GlideRecord#gsc.tab=0
GlideRecord is used to Query the table in ServiceNow.
May be you are talking about g_form.getValue('FieldName')
Regards,
Kiran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 07:42 AM
gr.getValue returns a string and gr.FIELDNAME returns a glide element object.
If you are dumping the values into an array and continuing to iterate through the glide record, you'll want to use gr.getValue. Otherwise you could be storing a pointer in your array that changes every time the glide record iterates ( you'll end up with an array full of elements containing the last row in the glide record ).
A glide element has other helpful functions that you may need depending on how you are using it. Just look up that object in the API to see if you can leverage any.