amusick
amusick

Reputation: 31

Dynamics CRM 2011 - Field deleted after adding to view

First of all, forgive me if this is a duplicate question, however, I've looked for the answer to this problem for two days now with no luck, including the SO community.

I'm new to my job and I was tasked with making changes to a client's MS Dynamics. They wanted an additional field added to the Opportunity entity for a "Topic Category". It was designed to be an option set and be available on multiple entities so I created a global option set for the task. On the Opportunity entity itself, I created a new option set field and used the global option set for the options.

I'm able to add it to the form fine, however, when I try to add it to the views I run into an error saying that the field has been deleted and that I need to remove the field before I can save the view.

The exact error is:

This field has been deleted. To use or save this saved view, you must remove the field.

Image of the error.

EDIT:
After following the tracing suggestions, I was able to produce this in the error log.

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>2014-01-15T18:03:14.1961051Z</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 : 'SystemUser' entity doesn't contain attribute with Name = 'bsb_topiccategory'.</Message>
    <Timestamp>2014-01-15T18:03:14.1961051Z</Timestamp>
    <InnerFault i:nil="true" />
  </InnerFault>
</OrganizationServiceFault>

This was created when trying to save the view with the faulty attribute attached to it. Saving it seemed to be the only way to pop an error out to the log. All of that being said, I'm not entirely sure how to handle the error. I've looked through the entities and couldn't find a systemuser entity. Maybe I'm just missing something?

Upvotes: 0

Views: 1563

Answers (3)

amusick
amusick

Reputation: 31

I hate to answer my own question, but in case anyone runs into the same problems I did, I want to make sure the answer is known.

After looking at the permissions for the user I was logged in as, I noticed that the user only had administrative access. I was confused at first (again, my first forray into CRM) as I always thought of an Administrator with someone with "end all, beat all" access. This isn't the case with CRM. In order to make changes to the views, the user you're using needs to have "Full" access while having the "System-Administrator" role.

The answer seems incredibly stupid now that the problem is resolved, but if this helps anyone, I'll be a happy camper.

Upvotes: 1

Darren Lewis
Darren Lewis

Reputation: 8488

It maybe that an attribute has been deleted for an existing column in the view which has nothing to do with your optionset. That missing attribute would be validated when you try and make changes though.

In theory this should never happen as the system should prevent you from deleting an attribute that has dependencies (the view in this case). I'd still check all of the existing columns in the view do indeed exist as attributes on the entity.

If this does prove to be correct it looks like someone may have deleted the attribute directly from the database!

Upvotes: 1

Daryl
Daryl

Reputation: 18895

This is a total stab in the dark, but have you attempted to publish all customizations? You can delete something, but not publish the change and it'll still look like it's there.

Upvotes: 0

Related Questions