How to pass current record sys id from ui action to ui page in workspace?

Ankita Kolhe
Tera Contributor

Hi Community,

Having an UI Action in workspace & on click of that UI Action ,an UI Page should gets open. There I need to validate the sys id of the current record but I'm struggling with it.

 

UI Action:-

I'm passing sys id of record in url & trying to retrieve in UI Page html.

 

AnkitaKolhe_1-1704368509507.png

 

UI Page:-

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<label for="${jvar_app_query}" onclick="" dir="">${gs.getMessage("Parent Entity")}</label>
 
<input type="text" name="myparam" value="${sysparm_sysid}"/>
 
<g:ui_reference style="width:20px" query="active=true" name ="entity_name" id="entity_name" table="x_kpm79_kpmgi_iogc_kpmgi_iogc_entity_management_base" />
<button type="button" class="button button1" style="background-color: #04AA6D" onclick="test()">Ok</button>
</j:jelly>

 But the sys id value is not getting populated in text box;-
 
AnkitaKolhe_2-1704368797900.png

 

Can someone please help in this?

 

 
 
 

 

3 REPLIES 3

umaaggarwal
Giga Guru
Giga Guru

check the URL you are forming correct? Can you check this url manually providing sys id in browser? Does it work?

Also, I would suggest define a variable url outside show frame. Something like below

 

var url = 'define your url here' ( test it manually and make sure it is correct)

g_modal.showFrame({

title : 'yout title here',

url :url,

size: 'fw'

});

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Ankita Kolhe 

${sysparm_sysid} will work only when UI page is called using GlideDialogWindow when you set the preference

In your case you can get the URL value and parse and get the sysId

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

Hi @Ankur Bawiskar ,

 

Thanks for the response. Could you please help with the code to parse sys id?