locked
CRM 2011: Cannot add column from entity to view on same entity RRS feed

  • Question

  • Hi,

    I've created a custom solution and added the Lead entity into it. I'm currently trying to modify the All Leads view to add some extra columns but am encoutering some problems.

    In the Add Columns dialog, the Record Type selector only has related entities in it and not the Lead entity - so it appears as though I cannot add columns from this entity. However, the list of columns is initially populated with all the fields from the Lead entity. If I pick one, Rating for example, and click ok to add it, a new column is added to the view with a yellow exclamation triangle and a string of characters ("a_c4ae73bf...") rather than "Rating".

    On clicking save I get the error To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable items.

    I click to download log file and it contains:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Invalid FetchXml on SavedQuery.Update.Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2140991216</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Invalid FetchXml on SavedQuery.Update.</Message>
      <Timestamp>2011-07-26T10:32:43.2578125Z</Timestamp>
      <InnerFault>
        <ErrorCode>-2147220733</ErrorCode>
        <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
        <Message>The column, fetchxml, has invalid fetch.  Error : 'Team' entity doesn't contain attribute with Name = 'leadqualitycode'.</Message>
        <Timestamp>2011-07-26T10:32:43.2578125Z</Timestamp>
        <InnerFault i:nil="true" />
        <TraceText i:nil="true" />
      </InnerFault>
      <TraceText i:nil="true" />
    </OrganizationServiceFault>

     

    So it looks to me like it's trying to add the column name from the entity (Owning Team) that was selected in the Record Type selector.

    Should the Lead entity be an option in the Record Type selector? If so, it's not there, how can I fix this? If not, how do I add extra columns from the Lead entity?

     

    Regards,

    Matt

    Tuesday, July 26, 2011 11:46 AM

Answers

  • Right, it turns out it was because my user was set up to have an administrative licence. Changing this to Read-Write/Full has resolved the problem.

    This still seems like CRM's behaving badly though. It makes sense that the licence option prevents me seeing data in the front-end, but as an administrator I should be able to see the entities to customise them.

     

    Thanks for your input Daniel.

    Thursday, July 28, 2011 9:44 AM

All replies

  • It is possible that you have a broken customization. Can you try to export the customization of lead entity, find All Leads view, and post its fetchxml code here?

    The key message above is 'Team' entity doesn't contain attribute with Name = 'leadqualitycode'. So I think there is something wrong with the view definition.


    Daniel Cai | http://danielcai.blogspot.com
    Tuesday, July 26, 2011 3:46 PM
  • Hi Daniel,

    The contents of fetchxml before I try to add the extra field is:

                  <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
                    <entity name="lead">
                      <attribute name="subject" />
                      <order attribute="subject" descending="true" />
                      <attribute name="leadid" />
                    </entity>
                  </fetch>

     

    I am unable to post the fetchxml once I've added a field as I am unable to save the view due to the error I posted previously.

    Tuesday, July 26, 2011 3:59 PM
  • Quite strange. You mean in Record Type picklist, you cannot choose "Lead" as shown below? (The screen shot was borrowed from a blog post, which I think might help in your case too ^_^):

    What rollup do you have? This seems to me a platform bug based on what you have experienced.  


    Daniel Cai | http://danielcai.blogspot.com
    Tuesday, July 26, 2011 4:18 PM
  • It is very strange yes, what you say is correct, in my copy of that screen I do not have the "Lead" option.

    I had a look through that blog post and tried to follow it through, in doing so I discovered that I am not able to see Leads at all. In fact, I can't see any entities in the front end - I have no menu options in the left side bar. I have checked and my user has Admin, Customiser, Sales Person and Sales Manager roles.

    I get the feeling the same thing is causing both problems, but I'm just not sure what.

     

    I've got rollup 2 installed - on another server that also has rollup 2 installed I am able to see all of the front end entities (including Leads).

     

    Wednesday, July 27, 2011 9:51 AM
  • Right, it turns out it was because my user was set up to have an administrative licence. Changing this to Read-Write/Full has resolved the problem.

    This still seems like CRM's behaving badly though. It makes sense that the licence option prevents me seeing data in the front-end, but as an administrator I should be able to see the entities to customise them.

     

    Thanks for your input Daniel.

    Thursday, July 28, 2011 9:44 AM
  • Good to know that you have found the cause. I would probably have never thought of that myself, the message was sort of ambiguous. ;-)

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    Thursday, July 28, 2011 3:57 PM