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 Condition Issue

Former Member
Former Member
Hello,

I'm trying to set a condition via vbscript with no lick, here is mi code

option explicit

' Initialize an array of search conditions.
Dim oSearchConditions : Set oSearchConditions = CreateObject("MFilesAPI.SearchConditions")

' Create a search condition for the object class (Nro cite).
Dim oSearchCondition1 : Set oSearchCondition1 = CreateObject("MFilesAPI.SearchCondition")
oSearchCondition1.ConditionType = MFConditionTypeEqual
oSearchCondition1.Expression.SetStatusValueExpression MFStatusType.MFStatusTypeObjectTypeID, null
oSearchCondition1.TypedValue.SetValue MFDataType.MFDatatypeLookup, 1561
oSearchConditions.Add -1, oSearchCondition1


i get an error on line "oSearchCondition1.Expression.SetStatusValueExpression MFStatusType.MFStatusTypeObjectTypeID, null"

Type mismatch: 'Expression.SetStatusValueExpression' (0x800A000D)

I already tried changing MFStatusType.MFStatusTypeObjectTypeID to a number, to a different statustype, but same result.

Any help will be great.

Thanks!
Parents
  • I think the issue may be with the "null" you are passing. Try "nothing" instead. Those empty/default values can be frustrating in VBS!

    Also, with an ID like 1561, are you sure you're interested in the MFStatusTypeObjectTypeID and not just the MFStatusTypeObjectID? (ObjectID datatype is integer)
Reply
  • I think the issue may be with the "null" you are passing. Try "nothing" instead. Those empty/default values can be frustrating in VBS!

    Also, with an ID like 1561, are you sure you're interested in the MFStatusTypeObjectTypeID and not just the MFStatusTypeObjectID? (ObjectID datatype is integer)
Children
No Data