Hi ! Base on the code below, could you please help me on how to remove a selected dynamic property from SimpleAction. The code used to add a dynamic property : public AddDynamicPropertyController() { InitializeComponent(); var addDynamicProperty = new SimpleAction(this, "AddDynamicProperty", PredefinedCategory.RecordEdit) { Caption = "AddDynamicProperty" }; addDynamicProperty.Executed += AddDynamicPropertyOnExecuted; } private void AddDynamicPropertyOnExecuted(object sender, ActionBaseEventArgs actionBaseEventArgs) { if (!(View.CurrentObject is Currency currentObject)) return; var propertyName = "myDpo" + currentObject.Dpo.DpoProperties.Count; var objectSpace = Application.CreateObjectSpace(); var myDefaultValueObject = objectSpace.CreateObject(); myDefaultValueObject.Name = propertyName; myDefaultValueObject.PropertyType = typeof(DateTime); myDefaultValueObject.ValueDateTime = DateTime.Now; currentObject.AddProperty(myDefaultValueObject.Name, myDefaultValueObject.PropertyType); objectSpace.CommitChanges(); //currentObject.Session.CommitTransaction(); foreach (var property in currentObject.Dpo.DpoProperties.Values.Where(property => property.PropertyType == myDefaultValueObject.PropertyType && property.Name == myDefaultValueObject.Name)) { property.Value = myDefaultValueObject.Value; } objectSpace.CommitChanges(); //currentObject.Session.CommitTransaction(); View.ObjectSpace.CommitChanges(); ObjectSpace.Refresh(); } |