Hi,
I'm having a problem when creating a new view for the lookup dialog of the field "regardingobjectid" in the entity "serviceappointment" via the jScript method addCustomView(). Selecting another entity type in "Look for" after having displayed the custom view leads to the error "Entity Name specified in FetchXml does not match the entity name in the EntityExpression". When I select another system view in the same entity type as the custom view first, I can switch to the other entity types without any problems.
The jScript code for defining the view in the onLoad of serviceappointment is:
What am I doing wrong?
Thanks,
Hendrik
I'm having a problem when creating a new view for the lookup dialog of the field "regardingobjectid" in the entity "serviceappointment" via the jScript method addCustomView(). Selecting another entity type in "Look for" after having displayed the custom view leads to the error "Entity Name specified in FetchXml does not match the entity name in the EntityExpression". When I select another system view in the same entity type as the custom view first, I can switch to the other entity types without any problems.
The jScript code for defining the view in the onLoad of serviceappointment is:
var viewId = "{C5C26189-68CD-4dd9-8619-22CAB0078D12}";var entityName = "test_project";var viewDisplayName = "Test";var fetchXml = "<fetch version='1.0' " +"output-format='xml-platform' " +"mapping='logical'>" +"<entity name='test_project'>" +"<attribute name='test_customerid' />" +"<attribute name='test_matchcode' />" +"<attribute name='test_projectnumber' />" +"<attribute name='test_projectid' />" +"<order attribute='test_customerid' " +"descending='false' />" +"<filter>" +"<condition attribute='test_customerid' " +"operator='eq' " +"value='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' />" +"</filter>" +"</entity>" +"</fetch>";var layoutXml = "<grid name='resultset' " +"object='1' " +"jump='test_projectnumber' " +"select='1' " +"icon='1' " +"preview='1'>" +"<row name='result' " +"id='test_projectid'>" +"<cell name='test_customerid' " +"width='200' />" +"<cell name='test_projectnumber' " +"width='200' />" +"<cell name='test_matchcode' " +"width='100' />" +"</row>" +"</grid>";var lookupControl = Xrm.Page.getControl("regardingobjectid"); lookupControl.addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, false);
What am I doing wrong?
Thanks,
Hendrik