Database View querying

uma17
Tera Guru

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

7 REPLIES 7

Kalaiarasan Pus
Giga Sage

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);


}


Hey Kalai,



I have referred using the variable prefix but its not working.



Thanks


Uma


This is a working code and I just tried that on the demo instance


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.