Calling script Include from UI Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 04:45 AM
Hello,
I have a requirement to call Script Include from UI Script as below
From UI Script : 1) Finding an event as load of List layout as below
if(String(document.location).indexOf('core_company_list.do) > -1&& String(document.location).indexOf('sysparm_view=selectcompany') > -1){
}
If this condition is true, i have to call a Script Include by passing a parameter to script Include where my script include validates with this parameter and decides the screen redirection based on validation.
Script Include : It contains simple function which returns array of values based on validation of parameter passed.
I have to use this Script Include for list filter like javascript:scriptIncludeName();
This is for filtering list layout and redirection based on script return values as i have to pass a parameter on load.
can any one please help me.
Thanks,
Pavan.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 04:51 AM
You are going to have to use GlideAjax to do call a script include from a UI Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 05:06 AM
Hi Pavan,
You should make that script include client callable and use GlideAjax to call that function.
Please refer http://wiki.servicenow.com/index.php?title=GlideAjax
Hope that helps.
Thanks,
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 05:17 AM
Hi Manish,
Thanks for your reply.
Here I have to use same Script Include function to filter list layout( like i have to call this function in query condition also like below sysparm_query=nameINjavascript:ListofCompaniesbasedonDomain()
if i make this as Ajax callable function i am unable to call this function like specified above while filtering list
so Making my script Include as Ajax callable is not helping me out.
Can you please share your ideas on this.
Thanks,
Pavan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2014 05:59 AM
Hi Pavan,
If you want to do so, please make a global business rule with client callable true.
That will work for you.