This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to compare values on a look up between two related objects

Hi!
I have a question to se if it's possible to compare values from the same property but on two different objects.

Example.
Lets say we have two objects.
A Document package and documents related to that package.

Document package has a lookup property to facility which is a object in M-Files.

So Document Package 123 has
Facility A
Facility B

Now we have the Document that has 
Facilty A 
Facility B

And we try to add Facility C to the Document.

When adding facility C i would like to raise an error because it should not be possible to set facilities that are not on a Document Package level.

And I would also like to raise an error on the Document Package level if a user wants to remove a facility value when there are documents that have that facility.

So I need to compare the two objects and there facility values so that they match.
Could this be done using property calculator or is this more of an vb-script solution.

  • You will always need to validate these rules so you will need to use some change event
    for example, BeforeCheckinChangesFinalize or some others that best fit your needs

    You can do this in VBScript or C#. For me, the second option is better because you will have the features that an IDE can offer you like Visual Studio.
    Take a look at the portal https://developer.m-files.com/