public override void OnAdded(SPAddFieldOptions op) { using (new EnterExitLogger("CCSCascadedLookupField:OnAdded function")) { base.OnAdded(op); Update(); if (!string.IsNullOrEmpty(AdditionalFields)) { string[] AdditionalFieldsArray = AdditionalFields.Split(new string[] { ";#" }, StringSplitOptions.None); if (AdditionalFieldsArray.Length > 1) { for (int i = 0; i < AdditionalFieldsArray.Length - 1; i += 2) { if (!this.ParentList.Fields.ContainsField(this.Title + " : " + AdditionalFieldsArray[i])) { //create a new field string depLookUp = this.ParentList.Fields.AddDependentLookup(this.Title + " : " + AdditionalFieldsArray[i], this.Id); SPFieldLookup fieldDepLookup = (SPFieldLookup)this.ParentList.Fields.GetFieldByInternalName(depLookUp); if (fieldDepLookup != null) { fieldDepLookup.LookupWebId = this.LookupWebId; fieldDepLookup.LookupField = AdditionalFieldsArray[i + 1]; fieldDepLookup.Update(); } } } } } } }
public override void OnAdded(SPAddFieldOptions op) { using (new EnterExitLogger("CCSCascadedLookupField:OnAdded function")) { base.OnAdded(op); Update(); if (!string.IsNullOrEmpty(AdditionalFields)) { string[] AdditionalFieldsArray = AdditionalFields.Split(new string[] { ";#" }, StringSplitOptions.None); if (AdditionalFieldsArray.Length > 1) { for (int i = 0; i < AdditionalFieldsArray.Length - 1; i += 2) { if (!this.ParentList.Fields.ContainsField(this.Title + " : " + AdditionalFieldsArray[i])) { //create a new field string depLookUp = this.ParentList.Fields.AddDependentLookup(this.Title + " : " + AdditionalFieldsArray[i], this.Id); SPFieldLookup fieldDepLookup = (SPFieldLookup)this.ParentList.Fields.GetFieldByInternalName(depLookUp); if (fieldDepLookup != null) { fieldDepLookup.LookupWebId = this.LookupWebId; fieldDepLookup.LookupField = AdditionalFieldsArray[i + 1]; fieldDepLookup.Update(); } } } } } } }
public override void OnAdded(SPAddFieldOptions op) { /*We will need to update the field again after it is added to save the custom setting properties. For more * info see http://msdn.microsoft.com/en-us/library/cc889345(office.12).aspx#CreatingWSS3CustomFields_StoringFieldSetting */ base.OnAdded(op); this.Update(); }
public override void OnAdded(SPAddFieldOptions op) { this.ShowInEditForm = false; this.ShowInNewForm = false; base.OnAdded(op); Update(); }
public override void OnAdded(SPAddFieldOptions op) { EnsureCustomPropertiesFixIfNeeded(); // without this all dependent fields would be created twice in list while adding a new site column to a site content type if (op != (SPAddFieldOptions.AddFieldInternalNameHint | SPAddFieldOptions.AddToNoContentType)) { AddDependentLookups(); } base.OnAdded(op); }
public override void OnAdded(SPAddFieldOptions op) { base.OnAdded(op); if (this.ParentList != null) { this.ParentList.EnsureEventReciever(typeof(UpdateLinkViewItemReceiver), 1000, SPEventReceiverSynchronization.Synchronous, SPEventReceiverType.ItemAdded); } this.ShowInDisplayForm = false; this.ShowInEditForm = false; this.ShowInNewForm = false; this.ShowInVersionHistory = false; this.Update(); }
public override void OnAdded(SPAddFieldOptions op) { //var data = FieldManagement<ImageFieldProperties>.GetFieldProperties(this); //if(string.IsNullOrEmpty(data.WebId)){ // data.WebId = SPContext.Current.Site.RootWeb.ID.ToString(); //} try { FieldManagement <ImageFieldProperties> .SetFieldProperties(this); } catch (Exception ex) { Utility.LogError(ex); } }
public override void OnAdded(SPAddFieldOptions op) { //var data = FieldManagement<ImageFieldProperties>.GetFieldProperties(this); //if(string.IsNullOrEmpty(data.WebId)){ // data.WebId = SPContext.Current.Site.RootWeb.ID.ToString(); //} try { FieldManagement<ImageFieldProperties>.SetFieldProperties(this); } catch (Exception ex) { Utility.LogError(ex); } }
public override void OnAdded(SPAddFieldOptions op) { base.OnAdded(op); this.Update(); }
/// <summary> /// Fires when a new filtered lookup field is added /// </summary> /// <param name="op"></param> public override void OnAdded(SPAddFieldOptions op) { base.OnAdded(op); Update(); }
public override void OnAdded(SPAddFieldOptions op) { this.Hidden = true; base.OnAdded(op); Update(); }
public virtual string CreateField(SPFieldCollection fieldCollection, XmlNode schemaXml, bool addToDefaultView, SPAddFieldOptions options) { return fieldCollection.AddFieldAsXml(schemaXml.OuterXml, addToDefaultView, options); }
public override void OnAdded(SPAddFieldOptions op) { EnsureCustomPropertiesFixIfNeeded(); // without this all dependent fields would be created twice in list while adding a new site column to a site content type if (op != (SPAddFieldOptions.AddFieldInternalNameHint | SPAddFieldOptions.AddToNoContentType)) { AddDependentLookups(); } base.OnAdded(op); }