Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to Hide catalog item on service portal based on users country

Sanket Pawar
Tera Contributor

Hi All,

I have an requrement where the catalog item should be hidden on portal if the currently logged in user's country is Finland . Any guidance will be helpful.

 

Thanks!

16 REPLIES 16

sure.

var usr = new GlideRecord('sys_user');
var country = 'Finland';
usr.get(gs.getUserID());
if (usr.country == country) {
retVal = true;
} else {
retVal = false;
}

change this line var country = 'Finland'; to '

var country = 'FI'; 

 

you need to user backend name for country

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure