I wan't to check specific PropertyValue is empty with VBScript. I found sample code from user guide, but it doesn't specify where to get PropertyDef or PropertyValue.
Here's the example I'm talking about:
Option Explicit
Dim szPropertyName, szValue
szPropertyName = PropertyDef.Name
szValue = PropertyValue.GetValueAsUnlocalizedText
If Len( szValue ) < 10 Then
Err.Raise MFScriptCancel, "The property """ & szPropertyName & """ must have a value of at least 10 characters."
End If
This is what I've been working with:
Option Explicit
Dim oProperty : Set oProperty = CreateObject("MFilesAPI.PropertyValue")
oProperty.PropertyDef = 1041
Dim oValue : Set oValue = CreateObject("MFilesAPI.PropertyValue")
oValue = PropertyValue.GetValueAsUnlocalizedText
If Len( oValue ) <= 0 Then
'Do stuff
End If
Running this script generates error Variable is undefined: 'PropertyValue' as expected, but how do I get the PropertyValue for specific property. Also how to check if it's empty?