Tag Info

Hot answers tagged

3

Explanation Based on your affirmative response to my comment, I've gone ahead and wrote this using the JSOM API. The script works by disabling the ReadOnly property on the RichMessage field, updating the values on your target item, and re-enabling the ReadOnly field. Up until now, this is the only working strategy I've found to change read-only fields from ...


2

Avoid using SPContext inside receiver. SPContext doesn't exist in a feature receiver. Instead use the Properties object as it includes a reference to the site or web use following public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb web = properties.Feature.Parent as SPWeb; using (SPSite site = new ...


2

Because you do not Change the value in the field, you just Change the value in your variable. you have to item[fieldID] = "";


1

You can modify item properties, except ID like this. public override void ItemAdding(SPItemEventProperties properties) { string mycol_internal = ""; using (SPWeb web = properties.OpenWeb()) { mycol_internal = web.Lists[properties.ListId].Fields["My Column"].InternalName; } properties.AfterProperties[mycol_internal] = "your new ...


1

What you want to do is use the Feature Upgrade mechanism to add the columns to the already existing list. If you just re-deploy the feature without "upgrading", then yes, the existing list will be overwritten with a new, blank list. Here is some documentation on MSDN about Feature Upgrades. Here is a series of blog posts by Chris O'Brien about Feature ...



Only top voted, non community-wiki answers of a minimum length are eligible