Unique Number Web Service and External SQL Datasource

S

SandraAJones

We have created an Infopath form that is linked to an external SQL database.
Now I want to utilize the Unique Number Web Service that I use in other
Infopath forms to place a number in one of the fields in the SQL Database
through the OnLoad Event.

When I follow the schema convention for an internal datasource, there are
too many : and I get an EOF error message. If I use @with the field name in
the schema, the script runs until it attempts to check the field for =="" and
the error message is that the object cannot be created.

I then attempted to create a field in the Infopath form that the Web Service
can access, but continue to get the same error message.

I know that the Web Service runs as I have put it into play in 2 other
Infopath forms.

Help!!
 
A

Adam Harding

Sorry Sandra if i am looking at this the wrong way but wouldn't you be better
off submitting to the database first and using its autogenerated number to
send to the web service?
 
S

SandraAJones

No, as I want the Unique Number to populate on opening a blank form. The
information is then sent to the data base once the form is populated by the
user. This send would include the Unique Number associated with the data.

The only other way would be to assign a Unique Number from the SQL data on
form open, then when the form is saved, populate the fields in the database
in the same record with the user data. Is this possible instead?
 
S

SandraAJones

I got this figured out. The structure needed to be var objField1 =
XDocument.DOM.selectSingleNode("/dfs:myFields/my:UniqueNumber");if
(objField1.text == "") for the call statement to work.

I also had to set up a second dfs named space and the first one was for
database data. I named the second one dfs1 and call that one out in the Web
Service result line:
var objResultField =
objWSDom.selectSingleNode(/dfs1:myFields/dfs:dataFields/tns:GetNextAppReqNumberResponse/tns:GetNextAppReqNumberResult"

This information is then placed in the objField1.text field:
objField1.text = objResultField.text;
 

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