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

(VB) Want to check if a property of the current object exist in another one

Hi,

I a mtrying to write a worklow.

the current object/ class is as follow : class is email, object is document, and the property is the "From" field

I would like to check with VB if the "from" value exists in any of my 'contacts' objects as email property value.

('1060 is the email property in a contact object)

I am new in vb script and I can't understand how to get the collection of contact's email property values

Dim szemailA=oPropertyValues.SearchForProperty(1243).TypedValue.DisplayValue ' email "From"

CREATE A COLLECTION OF email's contact 

For each email in emailcontactcollection

if email=szemailA or email email=szemailDe then

...

exit for

next

Many thanks in advance for any help

Parents
  • What is your goal here? Is it to automatically add the contact if the email is found? In that case you could simply use a search with conditions including:

    • Object type = contact (or person or whatever object type is used for contacts)
    • Not deleted
    • displayvalue of contact's email property is equal to szemailA

    Run the search. If results count > 0 then add the result(s) to your contact property.

    If you just want to verify that there is a contact with that email then you can use the same setup and finish off like this: If results count > 0 then Output = True

  • HI thanks for your reply.

    My goal is to automatically detect when a new email OBJECT is created if a contact already exists and then inform the user if not (maybe start creating a new one but might a bit more complcated)

Reply Children