Catalogue parameters

tillu
Giga Expert

Hi all,

I have the following scenario:

From a call I want to create a new request and pass the call reference number. When the call is updated and saved, the user is redirected the the catalogues page (not catalogue items) to select a catalogue. At this point I am passing the call sys_id as a parameter in the URL and that is fine.

However, when I select a catalogue and the relative catalogue items are displayed, the call sys_id is lost because the catalogues themselves have their own URL. To solve this I used the document.referrer which still stores the call sys_id. And this works fine in Chrome, Firefox, and I believe in Opera as well. The issue is IE. In IE, specifically if it is a secure page (https), document.referrer is blank. Also, the use of the referrer is more of a hack.

Any ideas?

1 ACCEPTED SOLUTION

tillu
Giga Expert

Ok, problem solved. When coming from a call, the link used was 'catalog_home.do?sysparm_view=catalogs_default&sysparm_callsysid=' + current.sys_id. I changed that to:



'catalogs_home.do?sysparm_view=catalogs_default&sysparm_callsysid=' + current.sys_id (note catalogs not catalog)



Then I shifted the customised logic I wanted from the ui page 'catalog_home' to 'catalogs_home'. In so doing I still have the call sysid to do my processing logic. When I select a catalogue and are navigated away to the catalogue item selection, at that point the call sysid is lost but at that point I have my processing done.


View solution in original post

5 REPLIES 5

Tim Deniston
Mega Sage
Mega Sage

What URL parameter are you using to pass this info? If you look at the Create Request UI Action on the Incident table, it uses the following, which I have used to also pass additional parameters:



sysparm_processing_hint=setfield:request.parent="


From call using the following:



var url = 'catalog_home.do?sysparm_view=catalogs_default&sysparm_callsysid=' + current.sys_id;


action.setRedirectURL(url);



The Catalogue is displayed correctly and the call sys_id is passed through as well. The problem is that clicking on the catalogue will navigate you to the catalogue items and the call sys_id parameter is lost. This is because ui page "catalog_home" is being used in both the display of the catalogue and the catalogue items. Problem is that when the catalogue items are displayed the source URL is no longer the one passed from the call but the URL from the catalogue itself acting as hyperlink. Do not know if I explained myself clearly.


What syntax did you use to pass additional parameters with sysparm_processing_hint?

var url = 'catalogs_home.do?sysparm_view=catalogs_default&sysparm_callsysid=' + current.sys_id;


action.setRedirectURL(url);