Not able to use "addEncodedQuery()" function on client script

sr_surendra
Giga Expert

Dear all,

 

I've written on submit script on catalog task table.

this script contain addEncodedQuery function.

this script is giving error while submitting as shown in screenshot below while closing catalog task.

find_real_file.png

Can someone please help me on it

 

Regards,

Surendra

10 REPLIES 10

Allen Andreas
Administrator
Administrator

Hi,

 

Please post your full script. Can't help really without it.

 

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Jon Barnes
Kilo Sage

Client-side GildeRecord is different from the Server-side one and has limited features. If you need to use encoded queries, I would recommend you move your logic to a client-callable script include and use GlideAjax to call it and get the results you need.

Hello Jon,

 

I've tried using this function on script include also.

But script is not serving its purpose, maybe I'm doing some mistake.

Could you please check scripts and suggest if I'm doing anything wrong here.

New to work on script include..

 

Requirement:

not to allow to submit task if affected ci which is related list of catalog task, is not selected.

This should be applicable for few catalog items and one of assignment group only which I'm mentioning in this encoded string

 

find_real_file.png

 

Script include:

 

find_real_file.png

 

Upender Kumar
Mega Sage

Hi,

Yes you can use.Cause of error may that gr is not a GlideRecord object.

 

Thanks