locked
How to remove New buttons from lookup RRS feed

  • Question

  • Well this is something we can handle from security roles or otherwise unsupported. I found unsupported code below to hide the new button from lookup but this is not finding the component:

    // To hide “New” button – Post UR 13
    var lookupControl = Sys.Application.findComponent(“attr_name”);
    if (lookupControl != null){
    
    lookupControl._element._behaviors[0].AddParam(“ShowNewButton”, 0);
    }
    Ref: https://rajeevpentyala.wordpress.com/tag/hide-new-button/

    I want to remove the new buttons from both the lookup panel and a lookup window that appears when "Lookup more recoreds" clicked.

    Target platform: CRM 2013 and 2015

    Any help please?


    blog: <a href="http://technologynotesforyou.wordpress.com">http://technologynotesforyou.wordpress.com</a> | skype: ali.net.pk



    • Edited by Khadim Ali Thursday, May 14, 2015 12:49 PM
    Thursday, May 14, 2015 9:18 AM

All replies

  • HI,

    may be it is easy to use Ribbon Workbench for CRM:

    https://ribbonworkbench.uservoice.com/knowledgebase/articles/80806-download-ribbon-workbench-for-crm-2011-2013-2015

    to hide needed buttons?

    Thursday, May 14, 2015 11:43 AM
  • xjomanx,

    I believe Ribbon Workbench only works for CRM ribbons. While in this case I have to handle the buttons over the lookup components when user clicks to select the related record. Isn't it?


    blog: <a href="http://technologynotesforyou.wordpress.com">http://technologynotesforyou.wordpress.com</a> | skype: ali.net.pk

    Thursday, May 14, 2015 12:14 PM
  • I managed to remove the new button from the inline lookup using unsupported way. However can you tell me please if there is any supported/unsupported - other than using security role - way to remove the New button from the lookup dialog that appears after clicking "Look Up More Records", that opens in an iframe?

    To remove the new button from inline lookup:

    $(document).ready(function () {
    	$("#attribute_name").focus(function () {
    
    		var lookup = $("#attribute_name");
    
    		if (lookup.length > 0)
    		{
    			//lookup[0].prop('isinlinenewenabled', '0'); // doesn't work
    			lookup[0].setAttribute('isinlinenewenabled', '0');
    		}
    
    	});
    });


    blog: <a href="http://technologynotesforyou.wordpress.com">http://technologynotesforyou.wordpress.com</a> | skype: ali.net.pk


    • Edited by Khadim Ali Thursday, May 14, 2015 12:31 PM
    Thursday, May 14, 2015 12:30 PM
  • Sorry, i confused lookup and grid :(

    Friday, May 15, 2015 8:15 AM