Hi Everyone,
I am trying to run a simple JavaScript for DEACTIVATE button in Action bar of Account entity, DEACTIVATE should be visible to only owner of record.
JavaScript Used:
function controlvisibility()
{
var username = Xrm.Page.context.getUserName();
var userid = Xrm.Page.context.getUserId();
var ownerlookup = Xrm.Page.getAttribute("ownerid").getValue();
var recordownerID = ownerlookup [0].id;
var recordownerName = ownerlookup [0].name;
if(userid == recordownerID)
return true;
else
return false;
}
Any Help will be appreciated.
Regards,
Aman Anvaria
*This post is locked for comments