spmeta2 icon indicating copy to clipboard operation
spmeta2 copied to clipboard

Is there any way to rename content type assigned to list.

Open HeToC opened this issue 8 years ago • 3 comments

After assigning content type to list (actually sharepoint creates new list scoped content type based of the first one) its unable to rename it. (or assign new name while adding the link.

example:

            var baseContentType= new ContentTypeDefinition()
            {
                **Name = "Site scoped content type**",
                Id = new Guid("89a9424f-25ab-411c-9001-afbf5291b78a"),
                ParentContentTypeId = BuiltInContentTypeId.Item,
                Group = "Test group"
            };


            web.AddList(lstProjectJoural, list =>
                {
                    list
                        .AddContentTypeLink(new ContentTypeLinkDefinition {
                            ContentTypeId = baseContentType.GetContentTypeId(),
                            **ContentTypeName = "Descendant list scoped content type"**
                        })
                });

HeToC avatar Sep 27 '17 12:09 HeToC

Not at the moment, renaming content type within a list isn't supported yet.

First of all, can't see this feature being popular or demanded. Secondly, it would be a bit confusing within SPMeta2 usage - first we'd need to add a content type, and then add another definition or something to rename it. Another way around is to update the name is only it was resolve by ID.. but in this case, we wouldn't know if it was a resolution by Name or ID. Becomes confusing and might potentially raise tons of unexpected errors.

SubPointSupport avatar Sep 28 '17 04:09 SubPointSupport

Maybe, at ContentTypeLinkDefinition, we might enable Name property update if only resolution worked well by ID.

Would it be sufficient, @HeToC ? But again, could be a potential way to get into troubles.

SubPointSupport avatar Sep 28 '17 04:09 SubPointSupport

i think that would be good enough. There wont be any potential troubles in renaming list scoped content types.

HeToC avatar Sep 28 '17 09:09 HeToC