GlideAjax not work on service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2017 10:28 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2017 06:27 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2017 06:29 PM
Goran,
one more thing confirm with you if my solution is correct that service portal take place the oob form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 02:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2017 06:43 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 03:21 AM
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.