validate a field on form open. IP2007

B

Bob C.

I create forms in vb.net pulling info from Outlook. The IP form has a drop
down list of states, but if a value from outlook is not in the list the user
gets on indication of the problem. What type of xpath statement can I use to
see if a value exists in a list?
 
B

Bob C.

To clarify, the list is a secondary ds list of states. The field being
validated is in a repeating address list, where state is one of the elements
of an address.
 
S

S.Y.M. Wong-A-Ton

While you've provided additional info, it is still difficult for someone to
tell you what kind of XPath expression you'll need. But here are some
pointers: You could use a filter on the secondary ds looking for the selected
value and then count the amount of nodes that result from that. If the
count() is zero, the item does not exist in the list. I did something similar
in this article:
http://enterprise-solutions.swits.n...box-when-item-does-not-exist-in-combo-box.htm

Alternatively, if you're writing code, you could retrieve the secondary ds
using the DataSources object, loop through all the rows in the ds and check
whether the selected value exists.
 
B

Bob C.

Thanks SYM,

I was hoping for a Count type of xpath statement. In psudo-code it'd look
like this:

count the number of entries in the state_validation_list that match the
value of the field.

I'll pursue your recommendations.
 
Top