GlideAjax from UI Action

Andrii
Kilo Guru

Hi, I'm stuck with trying to call GlideAjax from UI Action ... suppose I need to surrender and agree that it is not possible.

But before I do that - I would like to ask you, experts *)

So I have some UI Action (on a List) that I want to call GlideAjax.

1 ACCEPTED SOLUTION

Ha-ha! *) I think I just ot too tired .. didn't notices   that my call of GlideAjax was incorrect:



was: var ga = new SuperGlue();


changed: var ga = GlideAjax('SuperGlue');



Thank you for trying to help me - sometimes we don't need correct answer - only somebodies intention to help*) Thank you!


View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Andri,



I have created a sample example in the below demo instance


https://demo007.service-now.com/login.do


Username : admin


Password : admin


Steps for testing :


Navigate to Incident module and then click on "New Button" on form.



I hope this helps


Yes, Pradeep, your code works on   Incident form and on List of Incidents ... and as I can see - you just used code from WIKI, probably I have some steps that are not standard.


edwin_munoz
Mega Guru

Hello Andrii,



Make sure that you have the Client checkbook selected and that you are wrapping the code in a function. Ex.



function test(){


//Your code here


}



Then on the onClick field call your function:


test();



Could you please explain the details of your requirements?



Thank you.


Edwin, I'm trying to "develop a bicycle" * ... because similar mechanism already available OOTB, but let me describe what I do:



on demo000 I have 2 UI Actions("Merge" and "SetParent") and 1 GlideAjax("SuperGlue") that are used in the following way:



On Incident list I select few Incidents and click on "Merge" - it will bring up dialog without selected Incidents to choose Parent Incident for selected. On th same dialog window I select 1 Incident and click on SetParent that should call GlideAjax and stick together child Incidents (selected previously) and parent Incident.



For now I can not even get initialization function to work from SetParent UI Action - debuging via alert says that SuperGlue (GlideAjax) is not defined.