I am not getting correct answer through encoded query in glide record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:45 AM - edited 06-04-2024 05:50 AM
it will not work as your trying gliderecord in client side. create client script to get the value from server to client side by using use glideajax
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:47 AM
any other method through which i can use encoded queries through client side or there is no option
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:49 AM
no you cannot you need to use server side methods to use addEncodedQuery. Create a client script and a script include using glideajax you can get the value which you need.
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:54 AM
ohh okay thank you it means
getEncodedQuery() and setEncodedQuery() is of no use in client side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 05:36 AM
Hi @Murtaza Saify ,
You are using wrong method in second line. it should be addEncodedQuery instead of getEncodedQuery. Update that and your code will work correctly.
I'm pasting the corrected code bewow.
function onLoad() {
var gr = new GlideRecord('cmdb_ci');
gr.addEncodedQuery('cost>10000');
gr.query();
var str;
var count=0;
while (gr.next()) {
str = str+ ' and ' + gr.name;
count++;
}
alert(str);
alert(count);
}
Hope this helps you.