create a button using UI Macro

surya123
Mega Guru

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

6 REPLIES 6

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).


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


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