0
votes

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?

3
SystemUser is the User record. You can view these under Settings -> Administration -> Users. As suspected you have an attribute bsb_topiccategory being used in the View that either no longer exists on the SystemUser entity or you don't have the required permissions to see it. If you're a System Administrator you need to decide on the correct approach for the business of either removing it from the view or adding it back onto the SystemUser entity. I suspect the removal from the view will be the likely outcome.Darren Lewis
@DazLewis bsb_topiccategory is the option set that I created initially to place on the form and view. How can it be deleted when I can plainly see it inside the fields list of the entity I'm trying to edit?amusick

3 Answers

1
votes

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!

1
votes

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.

0
votes

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.