The content type list uses the specified site column

Cheers SO Experts!

Can I specify which content types use a specified site column in SharePoint? I will need to delete a site column (it got hosed under-the-hood) and re-create it, and I want to know what types of content I need to remove from the site column before I delete it.

Any thoughts?

+1


a source to share


1 answer


Yes, loop over every SPSite, SPWeb, SPList, ContentType and show where it is used. This requires a special code :(

Otherwise, you might get the SharePointManager and use it too quickly.



Your best bet is to address the underlying problem that led you down this path and use the web interface to create content types. After some pain along this route, we learned that the only way to do it reliably is to create a function with columns and content types defined in it and release it as a solution. This gives you the ability to pinpoint content types and fields.

There is a lot of work to release contentypes / fields, but it is worth it to avoid having to run code all over the website to remove instances of the field that is wrong.

+2


a source







All Articles