how to create ui page by using ui actions

shabbir5
Tera Guru

Hi team,

 

I want to create a UI action on a custom table , button name is "more actions"

 

once that button is clicked , A ui page should populate , and it should have 3 options 

 

create incident , create problem , create enhancement 

 

once user click any one these options , a new record should open 

 

suppose customer clicks on enhancement, then new enhancement form should open

 

please provide your inputs?

 

Thank you,

Shabbir Shaik

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@shabbir5 

what did you start with? it's an easy requirement

1) in UI action you can use GlideDialogWindow

2) within the UI page add 3 links and they will take user to new record of those tables

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@shabbir5 

try this

UI Action: Client Side

Client checkbox - true

Onclick - openDialog()

Script:

function openDialog() {
    var dialog = new GlideDialogWindow('your_ui_page'); // name of your UI page
    dialog.setTitle('More Actions');
    dialog.render();
}

UI Page:

HTML:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<div>
    <button onclick="createRecord('incident')">Create Incident</button>
    <button onclick="createRecord('problem')">Create Problem</button>
    <button onclick="createRecord('enhancement')">Create Enhancement</button>
</div>
</j:jelly>

Client Script:

function createRecord(type) {
    var url;
    switch(type) {
        case 'incident':
            url = '/incident.do?sys_id=-1';
            break;
        case 'problem':
            url = '/problem.do?sys_id=-1';
            break;
        case 'enhancement':
            url = '/enhancement.do?sys_id=-1';
            break;
    }
    window.location = url;
}

Output:

AnkurBawiskar_0-1738128390581.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@shabbir5 

what did you start with? it's an easy requirement

1) in UI action you can use GlideDialogWindow

2) within the UI page add 3 links and they will take user to new record of those tables

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@shabbir5 

try this

UI Action: Client Side

Client checkbox - true

Onclick - openDialog()

Script:

function openDialog() {
    var dialog = new GlideDialogWindow('your_ui_page'); // name of your UI page
    dialog.setTitle('More Actions');
    dialog.render();
}

UI Page:

HTML:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<div>
    <button onclick="createRecord('incident')">Create Incident</button>
    <button onclick="createRecord('problem')">Create Problem</button>
    <button onclick="createRecord('enhancement')">Create Enhancement</button>
</div>
</j:jelly>

Client Script:

function createRecord(type) {
    var url;
    switch(type) {
        case 'incident':
            url = '/incident.do?sys_id=-1';
            break;
        case 'problem':
            url = '/problem.do?sys_id=-1';
            break;
        case 'enhancement':
            url = '/enhancement.do?sys_id=-1';
            break;
    }
    window.location = url;
}

Output:

AnkurBawiskar_0-1738128390581.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi 

I have an additional requirement to pass information from Incident record to new Problem record via a UI Action. For example if a customer clicks on create problem, then based on the information present in the current Incident (like short description, description, etc.), a new problem record should be created.

 

Please provide your inputs.

 

Thank you,

Harsha