Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / August 2006

Tip: Looking for answers? Try searching our database.

How to validate if an element within a repeating table is unique

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
IT PHYTOSAN - 29 Jul 2006 00:54 GMT
This should be straight forward but I am struggling. I have a simple one
table data base connection to "shipments" When someone enters a new
shipmentID I'd like to make sure that it is unique within the shipments
displayed in a repeating table (not necesarily all shipments in the database)

My XPATH expression to validate is: count(\\Shimpent\@ShipmentID[.]) >1 but
it does not seem to return the right results.

Thanks for your help

IT PHYTOSAN
Greg Collins [InfoPath MVP] - 31 Jul 2006 22:24 GMT
Your slashes are in the wrong direction, and you need the current() function.

See if this works any better: count(//Shimpent/@ShipmentID[. = current()/@ShipmentID]) >1

Signature

Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Visit InfoPathDev ( http://www.InfoPathDev.com )

IT PHYTOSAN - 01 Aug 2006 01:23 GMT
Thank you very much for your help.

Per your advice I have changed the expression. Please note that I am using
actual fields and not those used in the previous example. Embarque are
shipments and AndenIDMuestreo are loading docks.

count(//Embarque/@AndenIDMuestreo[. = current()/@AndenIDMuestreo]) > 1

Upon loading the form I get the following error:

The form definition (.xsf) file contains the following error:

Illegal "expression" expression:
self::node()[count(//Embarque/@AndenIDMuestreo[. =
current()/@AndenIDMuestreo]) > 1]
Unknown method.

self::node()[count(//Embarque/@AndenIDMuestreo[. =
-->current()<--/@AndenIDMuestreo]) > 1]

Please note that I am using IP2007 Beta 2

Thanks for your help

IT PHYTOSAN

> Your slashes are in the wrong direction, and you need the current() function.
>
> See if this works any better: count(//Shimpent/@ShipmentID[. = current()/@ShipmentID]) >1
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.