Skip to main content
Solved

Client script: Get current URL

  • April 22, 2022
  • 1 reply
  • 893 views

Forum|alt.badge.img+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

Best answer by Shneor Cheshin

@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'));
}

 

 

https://community.ifs.com/ifs-field-service-management-fsm-employees-partners-only-103/generate-a-direct-url-to-a-request-13279

 

View original
Did this topic help you find an answer to your question?

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

@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'));
}

 

 

https://community.ifs.com/ifs-field-service-management-fsm-employees-partners-only-103/generate-a-direct-url-to-a-request-13279

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings