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

Possible bug: PropertyDef object shows incorrect bool value for BasedOnValueList

Hello,

I Create a property and name it Country: Country is List of Countries (Countries is defined as ObjectType). When i access the property definition for Country and check for value PropertyDef.BasedOnValueList it returns true, although it is based on ObjectTypes.

I have verified property definitions for multiple properties with List(object types or value lists). the BasedOnValueList is always true.

I need to identify if the List is from ObjectType or from ValueList. Is there any other property will help me distinguish this.

Thanks,
Shoeb
  • Hi Shoeb,
    Technically there is very little difference between value lists and object types. In fact you can convert a value list to an object type. This will add the opportunity to add classes and properties to the object type, but all objects will retain their original IDs, and the Object Type itself will keep its ID from the time when it was a Value List.
    I can't be 100% certain, but given that both Object Types and Value Lists seem to be items in the same table in the database only with a limited set of options on the latter it would be very likely that BasedOnValueList cannot tell the difference. Therefor I'm not convinced that it is a bug at all.
    I have not tried but judging from www.m-files.com/.../index.html you should be able to retrieve a list of all "real object types" using GetObjectTypes. Then you should be able to check whether the ObjectType ID of your item is in that list.
    Alternatively you might be able to check whether the country object has a class property or other properties not present in Value List items.
    There might be easier ways that I am not aware of.
    BR, Karl
  • Thanks Karl,

    For the response. Yes I found out that we could use ObjectType: ValueListID, but I still didn't get it what would be the possible use of BasedOnValueList property.

    Regards,
    shoeb