3

I've declaratively created around a total of 50 custom fields. They are included in a content type.

The problem is when i create a custom list that uses the content type the fields get a missmatch of the displayname value.

As an example, I have a field with the following:

On Site Column Level and in the Content type:

  • InternalName: a
  • Guid: 123
  • DisplayName: b

On Custom List:

  • InternalName: a
  • Guid: 123
  • DisplayName: c

What I want on my Custom List:

  • InternalName: a
  • Guid: 123
  • DisplayName: b

So to be clear. The problem is on lists when I've added the content type.

I've crosschecked every step that I've done (The the guids, dispName, internalNames are correct in the content types xml.)

Don't have the same issue on the same server when i try with another custom Content Type.

However when I add the custom fields directly on the Custom List I don't get the same results. "It Works"

I've tested with adding manually and through ContentTypeRef in my List Definitions Schema

  • How are you adding the field to the list? Do you happen to give it another display name in for example a list definition? – Robert Lindgren Jul 3 '15 at 11:01
  • First Q: I've tested with adding manually and through ContentTypeRef in my List Definitions Schema. Second Q: I'm not givning two values. There should not be a differens between them. (It should be "b" in both instances) – George Norberg Jul 3 '15 at 11:14
  • OK, if it is the same behaviour when you add the field manually to the list, there should be no issue with the FieldRef in the list schema – Robert Lindgren Jul 3 '15 at 11:16
  • However that doesn't solve my problem. By using either of the mentioned method i still get the faulty behavior. – George Norberg Jul 3 '15 at 11:19
  • 1
    You say this: "However when I add the custom fields directly on the Custom List I don't get the same results. "It Works"", but then you say that the behaviour is the same, you lost me – Robert Lindgren Jul 3 '15 at 11:20
1

The problem was related to an automated Visual studio function when adding the Content Type to the List Definition using Visual Studios Interface. Somehow a mismatch was created.

Although recreating the list definition solved my issue it doesn't explain why there was a problem when I add the Content Type to Manually created Custom lists.

0

If you have Inherits='TRUE' then you may be getting the expected behavior. In this case changes to any of the properties of fields inherited from the base type will be ignored. Also, any attempts to remove fields inherited from the base type will be ignored. As far as I can tell, the only thing you can do when Inherits is true is add additional fields to the type – everything else is ignored.

See Custom Content Types and Inherits in SharePoint 2010 for more detail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.