Call a stored procedure to validate a cell

E

Eric

I have a xml document that needs has many rows in it, once the user changes
the policy number, I need to call a stored procedure to validate to ensure
that it is correct.
If it is incorrect, it needs to highlight the field that was editied in Red.
How do you add a custom validation process where it calls a stored procedure.

I can't preload the data to validate it against, as it is 250,000 rows,
which means it takes to long to bring up the form.

Is there an example of how to do that in infopath somewhere?
 
S

S.Y.M. Wong-A-Ton

You can use the following article to add and write code in a Validating event
of the policy number field on your form:
http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.xmlevent.validating(VS.80).aspx

I've written the following article that calls a stored procedure that
inserts a record into a database:
http://www.bizsupportonline.net/inf...ction-execute-sql-server-stored-procedure.htm

I've never tried it, but you might be able to modify the code in the article
to execute a stored procedure and then retrieve a value from the secondary
data source and use this value for validation in the Validating event?

If that is not possible, you could always write ADO.NET code to execute the
stored procedure and return a value.
---
S.Y.M. Wong-A-Ton
http://www.bizsupportonline.net/infopath-all-solutions.htm (100+ InfoPath
articles, tutorials, and solutions)
http://www.bizsupportonline.net/infopath2007/videos/ (InfoPath 2007 video
tutorials)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top