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

VBscript If statement

Hello just want some advise on my script below.

I just want to raise some error on 2 if conditions, the 2nd condition is working (Datediff).

But the frequency has a problem. I think it's due to the Frequency property Date type is a value list.

Condition

 If Frequency property is "Every 1 hour" it should raise an error

Thank you.

Parents
  • Please check, content of szFrequency, should be exact same string.
    I suggest use Value List ID instead of string. This ID can be get with this code:

    'Get choosed ID from single select Lookup
    intPDProplookup = CInt(oPropVals.SearchForProperty( iPDProplookup ).TypedValue.GetValueAsLookup.Item)

    And then in If statement compare Integers

Reply
  • Please check, content of szFrequency, should be exact same string.
    I suggest use Value List ID instead of string. This ID can be get with this code:

    'Get choosed ID from single select Lookup
    intPDProplookup = CInt(oPropVals.SearchForProperty( iPDProplookup ).TypedValue.GetValueAsLookup.Item)

    And then in If statement compare Integers

Children