Quantcast
Viewing latest article 3
Browse Latest Browse All 4

Hide / show new button in a lookup

This function allows you to hide the “New” button from a lookup to stop users to create new records directly from within the lookup window.

//*********************************************************
gLookupDisplayNewButton = function(field, bShow){ 
    /*
    This function is used ti hide or show the New button in a lookuup
    Params:    
                field = name of lookup field
                bShow = integer (0 = hide, 1= show)
    Returns:         parameter
    Example :        gLookupDisplayNewButton('cm_instellingid', 0);
    */
    var obj = document.getElementById(field);
    if(obj != null){
        obj.attachEvent("setadditionalparams",NewButton(obj, bShow));
    } 

    //*********************************************************
    function NewButton(field, bShow)  { 
        return function(){ 
            field.AddParam("ShowNewButton", bShow); 
        } 
    } 
}  

Viewing latest article 3
Browse Latest Browse All 4

Trending Articles