create a button using UI Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 10:19 PM
Hi All
Hw can we create a button using Ui Macro and on click of the button it should fetch values of few fields from incident table and populate it in a field in another page.
Thanks in advance
Surya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 10:24 PM
Hi Surya,
Please refer the below blog for reference.
http://www.servicenowguru.com/system-ui/ui-macros/add-me-ui-macro-user-group-fields/
GlideDialogWindow: Advanced Popups Using UI Pages - ServiceNow Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 10:39 PM
Hi Pradeep,
when I add the code for populating teh details, the button isnt operating
<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:sc_button id="test" title="title" label="Open KB" onclick="return testF()" />
<script>
function testF()
{
window.location = '/u_testt.do';
}
</script>
<g:evaluate>
var sid= ${current.sys_id};
var gr_sid= new GlideRecord('u_test_kb');
gr_sid.initialize();
gr_sid.number=jid;
var res=gr_sid.insert();
window.location = "u_testt.do?sys_id=" + res;
</g:evaluate>
<j:set var="jvar_u_kb_article_number" value="${jvar_gr.getValue('sys_id')}"/>
</j:jelly>
here number is the KB number and i m trying to populate it to field kb_article_number (both are custom tables).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2016 10:42 PM
Hi Pradeep,
when I add the code for populating teh details, the button isnt operating
<?xml version="1.0" encoding="utf-8"?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:sc_button id="test" title="title" label="Open KB" onclick="return testF()" />
<script>
function testF()
{
window.location = '/u_testt.do';
}
</script>
<g:evaluate>
var sid= ${current.sys_id};
var gr_sid= new GlideRecord('u_test_kb');
gr_sid.initialize();
gr_sid.number=sid;
var res=gr_sid.insert();
window.location = "u_testt.do?sys_id=" + res;
</g:evaluate>
<j:set var="jvar_u_kb_article_number" value="${jvar_gr.getValue('sys_id')}"/>
</j:jelly>
here number is the KB number and i m trying to populate it to field kb_article_number (both are custom tables).
Above reply had some err in pasting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2017 12:38 AM
Hi Pradeep,
I need to do do translation of UI macro variable on Service Catalog form. Could you help me here. I got some solution like initialize message when we initialize button, but i don't know how to initialize message and show on form.
Translation of UI macro variable on Catalog form
Regards
Gaurav Bhandari