Can you have 2 items in the Available for

Walter Toney
Tera Expert

I have a Catalog item that is using the Available for Option in the Maintain Item

 

there are  2 options...

 

option 1 is allowing members of branch see the item   (THIS OPTION WORKS)

 

 

checkCondition();
function checkCondition(){
var user = gs.getUserID();
var active = gs.getUser().getRecord().getValue('active');
var prog = gs.getUser().getRecord().getDisplayValue('u_program');
var div = gs.getUser().getRecord().getDisplayValue('u_division');
var branch = gs.getUser().getRecord().getDisplayValue('u_branch');
var type = gs.getUser().getRecord().getDisplayValue('u_employee_type');
if (active == true && type != "CTR" && prog == 'DRA && div == 'CDR' && (branch == 'B&P' || branch == 'Budget & Program ' || branch == 'Financial')) {
return true;
}
return false;
}
 
Option 2 is allowing members witha certain email domain to see the item  (THIS OPTION DOES NOT WORK)

 

checkCondition();

function checkCondition() {
var user = gs.getUserID();
var email = gs.getUser().getEmail();
if (email.indexOf('@winstarinc.com') > -1) {
return true;
}
return false;
}

 

 

can someone please look at option 2 and tell me where my error is?

 
1 ACCEPTED SOLUTION

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Walter Toney ,

Can you please add .toString() and try 

var email = gs.getUser().getEmail().toString();

I tried with your code giving toString it is working fine for me. 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

View solution in original post

3 REPLIES 3

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Walter Toney ,

Can you please add .toString() and try 

var email = gs.getUser().getEmail().toString();

I tried with your code giving toString it is working fine for me. 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Omkar,

 

got a question.. this worked on a normal Catalog Item .. .would this work for and external Content Item

I see no reason why it wouldn't but it does not seem to be the case

Walter Toney
Tera Expert

That was the solution.. thank you for you assistance