Database View querying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 05:38 AM
Hi,
I want to query a view, I am using GlideRecord to query the same, Will GlideRecord work? or do we have to use any other way to query the view.I am not able to understand how to refer to the fields either.Can any one help me out in querying the view and refering to its fields.
Thanks
Uma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 05:51 AM
Yes .. It works but you need to use table prefix_column name
Ex :
var gr = new GlideRecord('wf_activity_context');
gr.query();
if(gr.next())
{
gs.print(gr.wc_workflow_version);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 05:57 AM
Hey Kalai,
I have referred using the variable prefix but its not working.
Thanks
Uma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 06:06 AM
This is a working code and I just tried that on the demo instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 06:52 AM
I have a table which has the prefix "abc" in the view, I want to refer to the column in that table, whoes column name is name.
So I tried querying like below but nothing worked it says undefined.
gr.abc
gr.abc.name.