I am trying to hide or show a button based on if the user belongs to a particular team or not. I am doing this via a JavaScript function that returns either true or false.
This is working in all scenarios apart from when the button appears on a view of the entity. In this case the JavaScript never seems to run. However if the default for the custom rule is set to True then the button shows but if set to False it doesn't show. So it seems it is seeing the default of the Enable rule but not running the JavaScript in this instance.
Am I missing something here?
As requested here is the function, as I previously posted this function is working correctly in other contexts.
function allowedNewButton() {
if (UserHasTeam("Create Order")) {
return true;
} else {
return false;
}
}