karlenigma
05/11/2018, 12:39 PMif (userRole !== 1061 || userRole !== 3 || userRole !== 1060 || userRole !== 1065) {
var labelrequiredField = form.getField({id: 'custitem_label_required'});
labelrequiredField.updateDisplayType({displayType: serverWidget.FieldDisplayType.HIDDEN});
}
erictgrubaugh
05/11/2018, 2:25 PM&&
instead of ||
. With ||
, when you are logged in as, say, Admin (3), then your userRole
IS NOT 1061
, so the if
returns true and the field gets hidden.
That said, I much prefer the approach @lleclerc_zlab gave as it is so much more concise.
If/when we can use ES6, then we'll get the contains
method as well which will be even better.karlenigma
05/11/2018, 2:27 PMkarlenigma
05/11/2018, 2:27 PMerictgrubaugh
05/11/2018, 2:47 PM