Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

How to hide / show new button inside lookup

$
0
0

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();
}

}
}


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>