GlideElement

Saran Ramayanam
Tera Expert

Hi Guys,

                            Can anyone tell me the difference between gr.getValue(FIELDNAME); and gr.FIELDNAME;?/

                  Thanks in advance

2 REPLIES 2

kiranhegde
Mega Expert

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


danpatino
Tera Expert

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.