Add Link to variable selectbox in serviceportal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2024 12:13 AM
Hi,
I want to achieve that in the ServicePortal, when a new request is made and the variable “xy” is selected in a select box, the user is automatically redirected to a page specified in the client script. I have already written the code for this, but a JavaScript browser error keeps occurring.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// Überprüfe, ob die ausgewählte Variable den gewünschten Wert hat
if (g_form.getValue("select_the_reason_for_the_external_user_request") == 'teams_sharepoint') {
var url = 'www.test.com';
window.open(url, '_blank');
// Leite den Benutzer auf die gewünschte Seite weiter
openNewTab();
} else if (g_form.getValue("select_the_reason_for_the_external_user_request") == 'other_assap') {
// Führe die Catalog UI Policies show variable durch
g_form.setDisplay('show variable', true);
}
}
Thanks and BR
Jessica
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2024 01:58 AM
Hi @jess1245
You can refer below post and give it a retry. Ensure that you set Isolate Script to false as this requires DOM Manipulation.
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.