Does GlideRecordSecure works in UI page client script

Stefan Petkovic
Tera Contributor

Pretty much what the title says, I've been coding in client script and I have used GlideRecord, now I do get a warning that I shouldn't, so I was just wondering why I cannot use GlideRecord since I'm getting an error message. 
Last case scenario I switch to using GlideAjax.
What is the best practice here? 

1 ACCEPTED SOLUTION

Vanderlei
Mega Sage

Hello @Stefan Petkovic ,
The client script present in the UI Page is similar to the Client Script present in widgets and standard client scripts (on change, on submit, etc.)

This means that they are scripts that run in the browser with some ServiceNow Client APIs, such as g_form, Glide Ajax, g_user, etc.

This means that we cannot use GlideRecordSecure because it is a ServiceNow API Server, so the best practice is to use Glide Ajax to get the data from the Server

If my answer helped you, please mark my answer as helpful.

 

Vanderlei Catione Junior | LinkedIn

Senior ServicePortal Developer / TechLead at The Cloud People



View solution in original post

1 REPLY 1

Vanderlei
Mega Sage

Hello @Stefan Petkovic ,
The client script present in the UI Page is similar to the Client Script present in widgets and standard client scripts (on change, on submit, etc.)

This means that they are scripts that run in the browser with some ServiceNow Client APIs, such as g_form, Glide Ajax, g_user, etc.

This means that we cannot use GlideRecordSecure because it is a ServiceNow API Server, so the best practice is to use Glide Ajax to get the data from the Server

If my answer helped you, please mark my answer as helpful.

 

Vanderlei Catione Junior | LinkedIn

Senior ServicePortal Developer / TechLead at The Cloud People