Return multiple values from Glide Ajax

msrishilpa
Mega Expert

Hi all,

 

I have a requirement like to return multiple values from script include at a time from glide ajax call and I have to store those values in different variables.

Can anyone please let me know how to write a script.

 

I am calling Script include from Client script Glide ajax

10 REPLIES 10

Ashok Katam
Mega Guru

Hi Meda



you can retrieve multiple values from glide ajax as below on client side



Client side


===========


function PopulateFNandLNResult(response) {


            alert("Waiting for server Response");


   


      var result = response.responseXML.getElementsByTagName("result");


      var fn = result[0].getAttribute("FN");


      var ln = result[0].getAttribute("LN");


       


      g_form.setValue('f_n', fn);


      g_form.setValue('l_n', ln);


           


}



and on script include, after you processing your business logic, you can add multiple values like below to return them to client script



glideAjax


=========


result.setAttribute("FN", variable1);


result.setAttribute("LN", variable2);



Thanks !