The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

How to check a property value to make sure it is unique?

I want to define a property for an object and check values for duplicates. For example, in the property "foo", when I enter a value, I want it to warn me if some other object already has that same value for "foo".

I assume I'm to do this in the VBScript based property validator when defining the property, but I'm not sure how to access all the values for that property and check if it already exists or not.

I tried this with text type properties, but can it be done with "select from list" type properties as well?

Parents Reply
  • Yes, basically the customer is registering objects into the vault and each must have a unique ID number that suits the customer's desired format. (e.g., "A2023042401, B984375987...") If someone tries to register an object and uses an ID number that already exists, we want to reject that. (There is unfortunately no particular logic to the numbering, so we can't use automatic property defs.)

    We don't want to make a value list because the number of objects can reach six figures. So I assume it would follow 

    1. Get input value.

    2. Search for that value across all objects where this property is defined

    3. Raise error if found.

Children