The CreatorCon Call for Content is officially open! Get started here.

Creating a dynamic URL in a Record Producer?

CharlesR1
Kilo Guru

Hello all,

I'm not sure this is possible but we need to create a clickable link on a record producer to enable a new window to open with a URL comprised of static text and values retrieved from the selections made on the form.

We have already created a UI action which performs this task on the main table form, and we have created a UI Macro which provides a link to a static URL on a record producer, but we have not managed to merge the two! Can anyone point me in the right direction?

Thanks very muich,

Charles

Example of our UI Macro:

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<a href="https://community.servicenow.com/" target="_blank">Please Click Here</a>

</j:jelly>

Example of our UI Action:

function presentWindow(){

var URL1 = 'http://companyintranet.com/re1/searching.do?aty=';

var URL2 = g_form.getValue('u_test_field');

var URL3 = '&newInfodate=0';

window.open(URL1+URL2+URL3);   /*to open the window in new page*/

  }      

action.setRedirectURL(current);

10 REPLIES 10

Hi Charles,



Below is a small UI Macro I created.



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


My field <input type="text" id="myID" />




<script>


  function getValue(text){


  document.getElementById("myID").value = text;


  }



  </script>


</j:jelly>



and i have my OnChange client script which calls the script defined inside the UI Macro



getValue(newValue);