Hi,
I've tried many things but i can't seem to work it out. Searched far and wide on this forum and found many posts but none of them anwser my question:
I want to Hide a tab based on a lookup value. This code below does work, as in, it hides the tab. However: it ALWAYS hide the tab. I've tried matching on the name field, ID field. I've tried single quotations, double ....
Yes: i know this code if faulty since it will break if the lookup is empty, hence it needs second If statement validating the lookup actually has a value. Please disregard that error and hopefully someone can point out the error:
function HideContractenTabOnLoad(executionContext)
{
var formContext = executionContext.getFormContext();
var tabObj = formContext.ui.tabs.get("Contracten");
if (formContext.getAttribute("icarus_typecontact").getValue()[0].icarus_contacttype == "Deelnemer")
{
tabObj.setVisible(false)
}
}


