Sharepoint modify the field data in the Event

Abstract: Sharepoint modify the field data in the Event



public override void ItemUpdating(SPItemEventProperties properties) { 
	try { 
		string newFieldValue = GetNewFieldValue(); 
		object oldFieldValue = properties.AfterProperties[COLUMN_NAME]; 
		if (oldFieldValue == null || oldFieldValue.ToString() != newFieldValue) { 
			properties.AfterProperties[COLUMN_NAME] = newFieldValue; 
		} 
	} catch { 
		//Log the error, or take another appropriate action. 
	} finally { 
		base.ItemUpdating(properties); 
	} 
}

Original: Big Box  Sharepoint modify data in the field in Event


Guess you like

Origin www.cnblogs.com/petewell/p/11516605.html