Hi all
How to hide / show new button inside lookup control dependence option set control
i can't use create privilege.
I used javescript
function HideNewButtonFromLookUp(context)
{
var headcounttype= Xrm.Page.getAttribute("new_headcounttype").getValue();
if (headcounttype!= null) {
if (headcounttype== "Hiring") {
var lookupControl = Xrm.Page.data.entity.attributes.get(“new_employeename”).getValue();
if (lookupControl != null){
lookupControl._element._behaviors[0].AddParam(“ShowNewButton”, 1);
context.getEventArgs().preventDefault();
}
}
else {
lookupControl._element._behaviors[0].AddParam(“ShowNewButton”, 0);
context.getEventArgs().preventDefault();
}
}
}
*This post is locked for comments