- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 07:22 AM
Hi All,
I have a UI Page(xyz) which invokes a UI Macro to show few buttons on header and carry out buttons functionality.
I have a UI Action created to incident page which shows as a link on the form.
When i click on the link (created by ui action) in the incident page , then i want it to perform what the UI page (xyz) does .[ That is loads a page with header and buttons].
Is it possible that when I click on the UI Action link, it performs what is being carried out by UI Page.
Please let me know if there is any other approach in which this can be achieved or if this is possible then share the script for same.
Thanks in advance
Surya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 10:30 AM
For example.. I have a ui page named testdriftinformation
here is the code below to get the ui action to load that page in the main window.
sendToNorChange();
function sendToNorChange()
{
//make the url to a new normal change
var url = 'testdriftinformation.do';
//Redirecting the user to the new url
action.setRedirectURL(url);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 07:30 AM
Hi Surya,
You can do that by using below script.
function popupDispList() {
//Initialize the GlideDialogWindow
var gdw = new GlideDialogWindow('UI page name');
gdw.setTitle('Incidents');
gdw.setPreference('table', 'incident_list');
gdw.setPreference('sysparm_view', 'default');
//Open the dialog window
gdw.render();
}
For more details refer Displaying a Custom Dialog - ServiceNow Wiki
Thanks,
Ravi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 07:53 AM
Hi Ravi
I added the Ui page name , but then it is displaying the incident list but not the ui page which was designed using macro.
Thanks
Surya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 07:59 AM
gdw.setPreference('table', 'incident_list');
In this instead of "incident_list" update with your table name.
ex: yourtable_list
_list is required only replace incident with your table name.
If you are not using the table name just remove that line and try.
function popupDispList() {
//Initialize the GlideDialogWindow
var gdw = new GlideDialogWindow('UI page name'); // Required
gdw.setTitle('Incidents'); // Update your page name (your wish)
gdw.setPreference('table', 'incident_list'); // Optional parameter
gdw.setPreference('sysparm_view', 'default'); // optional parameter
//Open the dialog window
gdw.render(); // mandatory
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 09:43 AM
Hi,
This works fine but I want when I click on the UI Action Link it opens a complete screen which shows a header and a button( as specified in Ui Page) but not as dialog.