Theo,
If it needs to be flexible you could create a list of field names of both entities (or retrieve them from MX Model Reflection). Then with the help of a little java, do a loop to retrieve the data from entity one and two and compare the data and then add the validation feedback.
This can also be done of course with microflows, just get the other entity record and add comparisons as a split to get the true or false.
Something like this, where obj and obj2 are generic IMendixObjects passed in as parameters.
String module = "TestModule";
String entity = "TestEntity";
Boolean includeVirtual = true, includeAssociations = true;
IContext context = this.getContext();
for(IMetaObject o: Core.getMetaObjects())
{
if(o.getName().equals(module + "." + entity))
{
for(IMetaPrimitive p: o.getMetaPrimitives())
{
if((!p.isVirtual() || includeVirtual) && (includeAssociations || !(p instanceof MendixObjectReference || p instanceof MendixObjectReferenceSet)))
{
if (!obj.getValue(context, p.getName()).equals(obj2.getValue(context, p.getName()))))
return false;
}
}
break;
}
} return true;
Edit: Small error in first post.Corrected and should work now.