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

Code to hide Document grid buttons

$
0
0

Hi Experts, I wrote the below code to hide upload button in document section, but I don't think it is working. I'm trying to hide the button depending upon field values on form. Am I doing something wrong? 

function HideButtonsAfterRouted(primaryControl) {
    formContext = primaryControl;
    debugger;
    var routed = formContext.getAttribute("new_routed").getValue;
    var initApproved = formContext.getAttribute("new_initiatorapproved").getValue;
    var recordType = formContext.getAttribute("new_recordtype").getValue;

    var entityname = formContext.data.entity.getEntityName();

    if (entityname == "new_request" && (recordType == 800000010 || recordType == 800000011)) {

        if (routed == 1)
            return false
        else
            return true;
    }
    else if (entityname == "new_request" && (recordType == 800000029 || recordType == 800000030 || recordType == 800000031 || recordType == 800000032)) {

        if (initApproved == 1)
            return false
        else
            return true;
    }
}



Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images