P
Philip Colmer
I'm embarking on updating a form and associated VB code to InfoPath 2007. I'm
starting to get the hang of the changes in the model but I've got a bit stuck.
My form uses secondary data sources. One of the places where I use this is
to search for a vendor in a database of vendors. The SQL Select statement is
updated by the form once the user enters part of the vendor name and the
Select statement executed.
The form then checks the resulting secondary data source to see if there are
zero matches, 1 match or more.
It is the "1 match" I'm struggling with because the code needs to then copy
that one match into the primary data source. Here is the original InfoPath
2003 code:
ElseIf recordsReturned.length = 1 Then
' We've only got one match - put it straight in.
Dim firstRecord As IXMLDOMNode =
thisXDocument.GetDOM("VendorNames").selectSingleNode("//d:Vendors")
Dim resultNode As IXMLDOMNode
resultNode =
e.XDocument.DOM.selectSingleNode("/my
urchaseOrderRequisition/my:Supplier/my:OracleVendorID")
resultNode.text =
firstRecord.attributes.getNamedItem("VENDOR_ID").text
resultNode =
e.XDocument.DOM.selectSingleNode("/my
urchaseOrderRequisition/my:Supplier/my:SupplierName")
resultNode.text =
firstRecord.attributes.getNamedItem("VENDOR_NAME").text
.... etc
I know how to change the code that sets the resultNode. What I'm struggling
with is how to get the values for VENDOR_ID and VENDOR_NAME.
Thanks ;-)
--Philip
starting to get the hang of the changes in the model but I've got a bit stuck.
My form uses secondary data sources. One of the places where I use this is
to search for a vendor in a database of vendors. The SQL Select statement is
updated by the form once the user enters part of the vendor name and the
Select statement executed.
The form then checks the resulting secondary data source to see if there are
zero matches, 1 match or more.
It is the "1 match" I'm struggling with because the code needs to then copy
that one match into the primary data source. Here is the original InfoPath
2003 code:
ElseIf recordsReturned.length = 1 Then
' We've only got one match - put it straight in.
Dim firstRecord As IXMLDOMNode =
thisXDocument.GetDOM("VendorNames").selectSingleNode("//d:Vendors")
Dim resultNode As IXMLDOMNode
resultNode =
e.XDocument.DOM.selectSingleNode("/my
resultNode.text =
firstRecord.attributes.getNamedItem("VENDOR_ID").text
resultNode =
e.XDocument.DOM.selectSingleNode("/my
resultNode.text =
firstRecord.attributes.getNamedItem("VENDOR_NAME").text
.... etc
I know how to change the code that sets the resultNode. What I'm struggling
with is how to get the values for VENDOR_ID and VENDOR_NAME.
Thanks ;-)
--Philip