GlideAjax not work on service portal

jonnyyan
Kilo Contributor

HI Team,

I have a include script and have a function named 'InitForm' , this function is do some initial work on page loaded. and the function is work fine on 'OnLoad'.

currently ,i want to invoke the same function on service portal, but there is no response, please refer to below screenshot:

I just create a new widget, and input a button, when i debug the code, the responseXML is undefined

find_real_file.png

find_real_file.png

9 REPLIES 9

Goran,



we have developed a script include before, and everything is working fine on form. but currently the customer said the OOB form is not user friendly .


so we decide to develop a service portal, and every form will rebuild on the portal, i want to see if the exist function can use for portal.


Goran,



one more thing confirm with you if my solution is correct that service portal take place the oob form?


Out can say that OOB there is a widget to display form on the portal. If you want to customize that, you can just clone that widget and customize how you want the look and feel to be. Your script include can be easily used by the server script just like any other server script using Script Include.



//Göran


davidarbour
Mega Contributor

There's no need to make AJAX calls from within a widget. Gather whatever data you need from the server in the provided server script, setting a property of the data object to the value you'd like to pass to the client. Then, in the client, call this.server.refresh(), which returns a promise from which you can call a callback function.



David Arbour


Ujjawal Vishnoi
Mega Sage
Mega Sage

In widgets, there is no need to use GlideAjax. You can write server side code in server script and can store the result in 'data.<any_name>'. To fetch the result stored in server you can use 'c.data.<any_name>' in client script, where c is the controller name.


If you still have more question then Please explain the requirement, so that we can write the code in widget itself.