Skip to main content
Solved

FSM - Button to launch URL with variable data

  • June 27, 2022
  • 2 replies
  • 126 views

AdrianEgley
Hero (Customer)
Forum|alt.badge.img+14

Hi,

Just wondering if it’s possible to allocate a URL to a button, and use data on the object i.e. a Task to use when building the URL itself.

 

Example being the task_id to be part of the URL when the button is selected on that record.

Tried a number of things such as a @ and {} on the object.

Is that possible?

We’re currently using FSM 5.7u11

Regards


Ady

Best answer by Shneor Cheshin

Hi @AdrianEgley 

2 options I can suggest:

  1. Create a “regular” filed and set it’s URL with a business rule or client script.
  2. Create a client script and set the URL dynamically. Set the script on any event you wish.

Client script

Pseudo code

var taskId = getControlValue('task','task_id');
var url = 'https://mysite.com/' + taskId
launchBrowser(url);

Demo of the 2 methods

In the demo I used UDF field to store the URL and used the asset/product search button as a clickable event for the client script.

 

Cheers!

2 replies

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28
  • Superhero (Employee)
  • 1183 replies
  • Answer
  • June 28, 2022

Hi @AdrianEgley 

2 options I can suggest:

  1. Create a “regular” filed and set it’s URL with a business rule or client script.
  2. Create a client script and set the URL dynamically. Set the script on any event you wish.

Client script

Pseudo code

var taskId = getControlValue('task','task_id');
var url = 'https://mysite.com/' + taskId
launchBrowser(url);

Demo of the 2 methods

In the demo I used UDF field to store the URL and used the asset/product search button as a clickable event for the client script.

 

Cheers!


AdrianEgley
Hero (Customer)
Forum|alt.badge.img+14
  • Author
  • Hero (Customer)
  • 176 replies
  • June 28, 2022

@Shneor 

Thank you. That’s my first client script done!

Created the client script and applied that to a button.

Also got some other fields that would benefit from having URL’s launched when clicked.

Cheers Ady