Hi!
For relations that you have created, there is a method called OnChangeBeforeUpdate on the class representing the relation that you can override to add your own logic. There are two different overloads of the method, one that is called when you can only select a single node, and one that is called when you can select multiple nodes.
The relation classes are located in the AqlRelations.cs file. Create a new .cs file in for the custom non-autogenerated code for the relation classes. I usually recommend also calling it AqlRelations.cs, but putting it in the WAF/Custom folder.
The method overload for single values, have two parameters for the old and new value. The method for multiple values have a parameter called added that contains a list of the nodes added to the relation, and a parameter called removed that contains a list of the nodes removed from the relation.
There are also two methods that are invoked after that change has been saved to the database, called OnChangeAfterUpdate.
Let me know if you need more info.
An example of the partial class for the relation:
using WAF.Data.Query;
using WAF.Engine.Query;
using WAF.Engine.Query.Advanced;
namespace WAF.Engine.Content.MySite{
public partial class RelTestATestB: WAF.Engine.Content.RelationBase{
public override void OnChangeBeforeUpdate(ContentBase content, Data.DataValue.NodeRelationDataValue dv, Common.ICKeyNxxC newValue, Common.ICKeyNxxC orgValue, Definition.MemDefProperty propDef, Definition.MemDefRelation relDef) {
//add your custom logic here
base.OnChangeBeforeUpdate(content, dv, newValue, orgValue, propDef, relDef);
}
public override void OnChangeAfterUpdate(ContentBase content, Data.DataValue.NodeRelationsDataValue dv, System.Collections.Generic.List<Common.ICKeyNxxC> added, System.Collections.Generic.List<Common.ICKeyNxxC> removed, Definition.MemDefProperty propDef, Definition.MemDefRelation relDef) {
//add your custom logic here
base.OnChangeAfterUpdate(content, dv, added, removed, propDef, relDef);
}
}
}