Display list of records based on ui action on ui page in workspace

Shubham Gagneja
Tera Guru

Hello,
I am trying to get record details based on my custom table form in workspace. I have 4 fields on my form, last name, first name, gender and dob. If a user enters value, there is a ui action checks the user info from my custom table based on the field value and opens a ui page displaying the records. I created the ui page and i did call it and i can see the ui page as a modal but info is not there. 
Can someone help me with the logic?

13 REPLIES 13

Shivalika
Mega Sage

Hello @Shubham Gagneja 

 

Please share your UI Action scripts and screenshot. Also UI page server side script and HTML and Client side script that you have done so far. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

My ui page jelly! 

ShubhamGagneja_0-1742907587318.png

processing script

ShubhamGagneja_1-1742907700992.png

ui action
Workspace script

ShubhamGagneja_2-1742907805373.png

right now when i click my ui action modal pops up without records like this

ShubhamGagneja_3-1742907864479.png

 

 



Hello @Shubham Gagneja 

 

Please use below 👇 script in UI action - 

 

function openUserInfoPage() {
var lastName = g_form.getValue('last_name');
var firstName = g_form.getValue('first_name');
var gender = g_form.getValue('gender');
var dob = g_form.getValue('dob');

var url = "/sys_ui_page.do?sys_id=<YOUR_UI_PAGE_SYS_ID>&last_name=" + encodeURIComponent(lastName) +
"&first_name=" + encodeURIComponent(firstName) +
"&gender=" + encodeURIComponent(gender) +
"&dob=" + encodeURIComponent(dob);

var myDialog = new GlideDialogWindow('<YOUR_UI_PAGE_SYS_ID>');
myDialog.setTitle('User Info');
myDialog.setSize(800, 600);
myDialog.setPreference('last_name', lastName);
myDialog.setPreference('first_name', firstName);
myDialog.setPreference('gender', gender);
myDialog.setPreference('dob', dob);
myDialog.render();
}

 

Below 👇 script in Jelly - 

 

<g:include src="ui_page_header"/>

<g:evaluate>

    var lastName = decodeURIComponent(g_request.getParameter("last_name"));

    var firstName = decodeURIComponent(g_request.getParameter("first_name"));

    var gender = decodeURIComponent(g_request.getParameter("gender"));

    var dob = decodeURIComponent(g_request.getParameter("dob"));

 

    var userRecord = new GlideRecord('your_custom_table');

    userRecord.addQuery('last_name', lastName);

    userRecord.addQuery('first_name', firstName);

    userRecord.addQuery('gender', gender);

    userRecord.addQuery('dob', dob);

    userRecord.query();

</g:evaluate>

 

<table>

    <tr>

        <th>Last Name</th>

        <th>First Name</th>

        <th>Gender</th>

        <th>DOB</th>

    </tr>

    <g:while var="userRecord.next()">

        <tr>

            <td>${userRecord.last_name}</td>

            <td>${userRecord.first_name}</td>

            <td>${userRecord.gender}</td>

            <td>${userRecord.dob}</td>

        <

/tr>

    </g:while>

 

There was problem with your input passing. Please try this and let me know if stuck. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

</table>

@Shivalika As far as i know, glidedialogwindow has been depricated since yokohama release. thats why i used g_modal show frame.