Problem is I am trying to update a content type (created within a list definition, going into a new list instance) and it is not liking the ID I pass in code. I tried passing JUST the child ID, parent & child, and full (base, parent, child) ID. All of these result in various errors (object reference error and format error).
I am updating in a seperate feature from the one that creates the list definition and new content type.
Why is this giving me trouble? Here is a code snippet.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
using (SPSite spSite = new SPSite("site"))
{
using (SPWeb web = spSite.OpenWeb())
{
SPField field = web.Fields[new Guid("e93f5414-1486-481e-842d-696df0ff9ce6")];
field.Group = "newAnimals";
field.Update();
SPContentType cType = web.ContentTypes[new SPContentTypeId("CE2744E3BAEA4734B2333D043AA5DD2C")];
cType.Description = "Super cool content type";
cType.Update();
}
}
}
Again...this is at the DEFINITION level so I want to make one update to the content type the definition is implementing and have that change pushed to ALL content types being used within ANY list implementing this particular definition.
I do not want to do this via CAML, I am looking for the programmatic method.