The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Passing URL to Classic UI catalog item

KDWeigel
Tera Expert

I'm having trouble passing values to catalog item.


I have created an UI policy which redirects to classic UI catalog item with variables in URL. The client script on cat item, which should retrieve parameters, seem to run before the URL has changed from the redirection syntax and therefore no values return. So the URL is still the same from where I click the UI Action. If i stand on the cat item and refresh the page, everything works fine, as the url have changed afterwards.

 

UI Action:

var businessapplication = 'ba';
var url =  
    '/com.glideapp.servicecatalog_cat_item_view.do?sysparm_id=6e6835b30f0ec300e8cdf88ce1050e10' +
    '&sysparm_ba=' + businessapplication;
action.setRedirectURL(url);

Cat client script:
    var url = top.location.href; // metode der finder ud af hvilken URL du stÃ¥r pÃ¥ lige nu
    var decodedUrl = decodeURIComponent(url);
    //var businessapplication = new URLSearchParams(decodedUrl.split('?')[1]).get("sysparm_ba");
    alert(businessapplication);
    g_form.setValue('cmdb_ci_class', businessapplication);
1 ACCEPTED SOLUTION

KDWeigel
Tera Expert

This post solved my problem.

View solution in original post

1 REPLY 1

KDWeigel
Tera Expert

This post solved my problem.