Home › Forums › Classic DFFS › v4.4.5.55 has been released › Reply To: v4.4.5.55 has been released
Hi Alexander,
They are dropdown. I am also getting another error on another piece of code. It seems like i don’t have the spjs.dffs? I am confused because some JS works and others don’t,
I am using this version DFFS_v4.4.5.55_2025-04-07.
This is the code. I am trying to just hide a tab based on a list that has a Person field and a Role field. I want to hide the tab based on the persons role. I attached the error as well. I feel like my problem is I am missing a file or something? Is there anyway I can get around this?
function checkUserRoleAndToggleTab() {
var currentUser = _spPageContextInfo.userLoginName;
// Query the Roles list for current user
spjs.dffs.getListItems({
listName: “Roles”,
query: “<Where><Eq><FieldRef Name=’Person’ LookupId=’TRUE’ /><Value Type=’Integer’>” + _spPageContextInfo.userId + “</Value></Eq></Where>”,
viewFields: [“Role”],
onComplete: function (data) {
var hideTab = false;
if (data.count > 0) {
var role = data.items[0].Role;
// Check if role is “Owner”
if (role && role.trim().toLowerCase() === “owner”) {
hideTab = true;
}
}
if (hideTab) {
spjs.dffs.hideTab(“test”);
} else {
spjs.dffs.showTab(“test”);
}
}
});
}
// Run the function
checkUserRoleAndToggleTab();