What is the difference between glideAjax and getReference()?

JKrucheck
Tera Contributor

Can somebody explain? 

1 ACCEPTED SOLUTION

ScienceSoft
Tera Guru
Hi, GrzegozhBzendzistykevich

getReference() is build-in AJAX to get GlideRecord that your reference field references.

Here is an example (with callback function):

find_real_file.png

function onChange(control, oldValue, newValue, isLoading) {
	if(newValue) {		
		var caller = g_form.getReference('caller_id',doAlert);		
	}
}

function doAlert(caller){
	if(caller.email == ''){
		alert ('This user does not have email');
        }
}

View solution in original post

3 REPLIES 3

Not applicable

Hi,

Go through the following link :

What is difference between GLIDE AJAX Call and getReference() call In client script.

 

Mark if helpful/Correct

Thanks

Ajay

ScienceSoft
Tera Guru
Hi, GrzegozhBzendzistykevich

getReference() is build-in AJAX to get GlideRecord that your reference field references.

Here is an example (with callback function):

find_real_file.png

function onChange(control, oldValue, newValue, isLoading) {
	if(newValue) {		
		var caller = g_form.getReference('caller_id',doAlert);		
	}
}

function doAlert(caller){
	if(caller.email == ''){
		alert ('This user does not have email');
        }
}

SagarTajane
Kilo Expert

Hello ,

 

It depends on performance of client.

If you're using getReference you will get ALL data for each record you "get" whether you need it or not.


If you're using GlideAjax you only get what you need, because you will explicitly return the exact information you need and nothing else.


Please go through this link :https://snprotips.com/blog/2016/2/6/gliderecord-client-side-vs-server-side

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks


Sagar Tajane