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

Search Conditions in VBS

Hello,

I am trying to search an object and one of the search condition should be YEAR.

I tried the following code, with no success:

	oSearchCondition.ConditionType = 1
    oSearchCondition.Expression.DataPropertyValuePropertyDef  = 1154
	oSearchCondition.Expression.DataPropertyValueDataFunction = 1
    oSearchCondition.TypedValue.SetValue 1, "2021"
    oSearchConditions.Add -1, oSearchCondition

The error returned is "Wrong data type".

Any tips on how to search for an object with a date PD, by year.

Regards,

Radu

Parents Reply
  • I would guide you to use the enumeration names rather than magic numbers, if you can.

    I work in M-Files a lot and I honestly don't know what the numeric values are for the enumeration values.  The same will be true of people who have to maintain this script in the future.

Children