Error in Query builder. Crm 2011 can't recognize file type with method addCustomView RRS feed

  • Question

  • Greetings friends,

    I am trying to make a filter in crm using for guidance the famous blog


    case III,

    but I am getting an error and I have no idea how I could sort things out!

    Error in Query builder. Crm 2011 can't recognize file type

    I have attached my code below.

    Thanks in advance,


    function ChangeLookupView_State() {
        var auftragId = Xrm.Page.data.entity.attributes.get("new_servid");
        var auftragGUID = auftragId.getValue()[0].id;
        var viewId = Xrm.Page.data.entity.getId();
        var entityName = "new_productid";
        var viewDisplayName = "Products";
        var viewIsDefault = true;
        var fetchXml =
    "<fetch mapping='logical'>" +
    	"<entity name='product'>" +
    		"<attribute name='name'/>" +
    		"<attribute name='productid'/>" +
    		"<link-entity name='new_servskatalogelement' from='new_produktid' to='productid'>" +
    			"<link-entity name='new_servskatalog' from='new_servskatalogid' to='new_servskatalogid'>" +
    				"<link-entity name='new_technischerauftrag' from='new_servskatalogid' to='new_servskatalogid'>" +
    					"<filter type='and'>" +
    						"<condition attribute='new_technischerauftragid' operator='eq' value='640D6C6F-6009-E111-BD1D-00155D0A3337'/>" +
    					"</filter>" +
    				"</link-entity>" +
    			"</link-entity>" +
    		"</link-entity>" +
    	"</entity>" +
        var layoutXml =
                        "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='1'>" +
                        "<row name='product' id='productid'>" +
                        "<cell name='name' width='200' />" +
                        "</row>" +
        Xrm.Page.getControl("new_productid").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, viewIsDefault);


    Thursday, November 24, 2011 2:05 PM


  • sorry solved its was a problem with this line. Here I didn't write the entity name of the form on which this lookup is but another.
    var entityName = "new_productid";
    Thursday, November 24, 2011 2:19 PM