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

Chuck Tomasi
Tera Patron

In order for the UI action to use the value, you'll need to store it somewhere from the record producer. A variable or a field value is needed. It doesn't necessarily need to be present on the form displayed, but it does need to be available somewhere in the record.


Hi Chuck, thanks for the reply.



Sorry, what I mean is that we need to have the ability for an end user to click a link on the Record Producer, and for the window to open before the record producer is submitted. The reason is that the URL will point to a page on which information will be provided which will then be copied and pasted back into the Record producer before it is submitted.



Thanks,



Ch


OK. Thanks for the clarification Charles. Where is the dynamic content coming from that constructs the URL?


Thanks Chuck,



The 'dynamic' sections of the URL need to be taken from the values of the selections that have been made on a number of choice and reference fields that appear on the Record Producer.



This is easy between a main form and a UI action,   but we're stuck on how to get values passed from a Record Producer into a UI Macro!



Thanks again for your help.


Charles