var objWeb = properties.Feature.Parent as SPWeb;
SPContentType contentType = objWeb.ContentTypes["Wiki Page"];
if (!contentType.Fields.ContainsField("Keywords"))
{
SPField field = objWeb.Fields["Keywords"];
SPFieldLink fieldLink = new SPFieldLink(field);
contentType.FieldLinks.Add(fieldLink);
contentType.Update(true);
}
I use This code in feature activation to add site column “KeyWord” to site content type “Wiki Page” my problem is “keyword” add in “wiki page” but not from the existing site column it’s add new site column. is there problem in my code?
one other thing this code works fine on my MOSS server when i deploy on office365 this problem i found
You should try the code below:
I hope someone is being helped from my code 🙂