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

Set automatic value of choose from list property

I have searched this forum already but could not find the answer I was looking for.

I like to automitcally set the value from a property that is normally controlled by choose from list.

I have an Value list with ID 104 and e.g. internal ID 1 as content value

Now I want to set property ID 1039 to fill inertal ID 1 from the value list ID 104

What I think it looks like but is not working:

Output = PropertyValues.SearchForProperty(1039).TypedValue.SetValue(MFDataType.MFDatatypeLookup, 1)

Parents Reply
  • From recollection (I don't use VBScript much) the output should be the typed value representing the value list item you want to point to.  Something like:

    Option Explicit
    
    ' Set up the typed value to return.
    Dim objTypedValue: Set objTypedValue = CreateObject("MFilesAPI.TypedValue")
    objTypedValue.SetValue MFDataTypeLookup, 1 ' 1 here is the ID of the item to point at.
    
    ' Set the output (i.e. make it return this value)
    Set Output = objTypedValue

Children