How to get sys_id in catalog client script

xiaix
Tera Guru

find_real_file.png

 

 

I know you can't use "current" in a client script, but is there any way to get that sys_id in the script?

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You can try using

 

var a = g_form.getUniquevalue();

alert('Sys id is '+a);

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

View solution in original post

7 REPLIES 7

rammohanraomadd
Kilo Guru

Hi David,

 

Please use the below script:

 

function onLoad() {
//Type appropriate comment here, and begin script below
var id = getParmVal('sysparm_id');
alert(id);
}

function getParmVal(name){
var url = document.URL.parseQuery();
if(url[name]){
return decodeURI(url[name]);
}
else{
return;
}
}

 

Regards,

Ram M

Beautiful.

 

I am redirecting internal people and ESS users that use the service catalog to the SP version like this:

 

find_real_file.png

 

It works like a charm.

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You can try using

 

var a = g_form.getUniquevalue();

alert('Sys id is '+a);

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

Harshad Wagh
Tera Guru

Hi, 

following quick one would also help.

 

console.info('catalog item'+g_form.getParameter('sysparm_id'));

 

thanks

Harshad