Solved

Client script: Get current URL

  • 22 April 2022
  • 1 reply
  • 707 views

Userlevel 5
Badge +13

Hi Experts,

 

There is a requirement to get the current web client URL to perform LaunchBrowser operation in client script.

Var link = “Current URL’?task.task_id=” +taskID;

 

var taskID = getControlValue('task','task_id');
if(taskID!='' && taskID!=null)
{
var link="Current URL?task.task_id="+taskID;
launchBrowser(link);
}
else
{
alert(getMessage('Error in Opening Tab','Information'));
}

Is there a way to achieve this using existing client script functions?

 

Thanks,

Hasara

icon

Best answer by Shneor Cheshin 22 April 2022, 08:42

View original

1 reply

Userlevel 6
Badge +26

@Hasara Dinu

Does  <CURRENT URL> changes?

As far as I know the URL is static. e.g. https://clientname-fsm-prod.ifs.cloud/WebClient

If that is the case, you can hard code the beginning of the URL and concatenate the task id that will be dynamically updated.

That was my solution for the same requirements I got. 

 

var taskID = getControlValue('task','task_id');
var url = "https://clientname-fsm-prod.ifs.cloud/WebClient/tab/screen/TASK?task.task_id=" + taskID

if(taskID!='' && taskID!=null)
{
launchBrowser(url);
}
else
{
alert(getMessage('Error in Opening Tab','Information'));
}

 

 

 

Reply