J
jake
Hello,
We have an infopath form that is retrieving an dataset from a
webservice. It takes the dataset and puts in into a repeating table. We have
a couple of textbox values in each repeating table. When the user updates a
specific record we want to trap their username and update the database.
Right now it seems to update all of the repeating tables with that value.
How can I just pass back and update only the changed records? Below is our
update code. Thanks.
Jake
Code---
Public Sub btnUpdte_OnClick(ByVal e As DocActionEvent)
' Write your code here.
Dim strXML As String = e.Source.xml
Try
Dim dataObj As WebServiceAdapter2, nodeReturn As
IXMLDOMNode, nodeimage As IXMLDOMNode
Dim GprojectidNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "gprojectid")
Dim CostCatagoryNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "costcatagory")
Dim ErrorDescriptionNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "errordescription")
Dim ResolvedNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "resolved")
Dim NotesNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "notes")
Dim i As Integer
Dim strValueError As Integer = GprojectidNodelist.length
Dim strReturnStatus As String =
ResolvedNodelist.Item(i).nodeTypedValue = e.ReturnStatus
Dim sign As String
Dim ab As String
Dim bb As String
Dim cb As String
Dim db As String
Dim eb As String
Dim fb As String, gb As String
For i = 0 To ResolvedNodelist.length - 1
'how to test if individual record elements are
dirty?
thisXDocument.DOM.selectSingleNode(RPTTBL +
"gprojectid").text = GprojectidNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"costcatagory").text = CostCatagoryNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"errordescription").text = ErrorDescriptionNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"resolved").text = ResolvedNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"notes").text = NotesNodelist.Item(i).text
dataObj = thisXDocument.DataAdapters("Update")
dataObj.Submit()
Next
thisXDocument.DOM.selectSingleNode(RPTTBL +
"gprojectid").text = ab
thisXDocument.DOM.selectSingleNode(RPTTBL +
"costcatagory").text = bb
thisXDocument.DOM.selectSingleNode(RPTTBL +
"errordescription").text = gb
thisXDocument.DOM.selectSingleNode(RPTTBL + "resolved").text
= cb
thisXDocument.UI.Alert("Update Successful!!!, Please Click
on Get Listings to return latest changes.")
Catch ex As Exception
Dim strBreak As String = "error"
End Try
End Sub
We have an infopath form that is retrieving an dataset from a
webservice. It takes the dataset and puts in into a repeating table. We have
a couple of textbox values in each repeating table. When the user updates a
specific record we want to trap their username and update the database.
Right now it seems to update all of the repeating tables with that value.
How can I just pass back and update only the changed records? Below is our
update code. Thanks.
Jake
Code---
Public Sub btnUpdte_OnClick(ByVal e As DocActionEvent)
' Write your code here.
Dim strXML As String = e.Source.xml
Try
Dim dataObj As WebServiceAdapter2, nodeReturn As
IXMLDOMNode, nodeimage As IXMLDOMNode
Dim GprojectidNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "gprojectid")
Dim CostCatagoryNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "costcatagory")
Dim ErrorDescriptionNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "errordescription")
Dim ResolvedNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "resolved")
Dim NotesNodelist As IXMLDOMNodeList =
thisXDocument.DOM.selectNodes(RPTTBL + "notes")
Dim i As Integer
Dim strValueError As Integer = GprojectidNodelist.length
Dim strReturnStatus As String =
ResolvedNodelist.Item(i).nodeTypedValue = e.ReturnStatus
Dim sign As String
Dim ab As String
Dim bb As String
Dim cb As String
Dim db As String
Dim eb As String
Dim fb As String, gb As String
For i = 0 To ResolvedNodelist.length - 1
'how to test if individual record elements are
dirty?
thisXDocument.DOM.selectSingleNode(RPTTBL +
"gprojectid").text = GprojectidNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"costcatagory").text = CostCatagoryNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"errordescription").text = ErrorDescriptionNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"resolved").text = ResolvedNodelist.Item(i).text
thisXDocument.DOM.selectSingleNode(RPTTBL +
"notes").text = NotesNodelist.Item(i).text
dataObj = thisXDocument.DataAdapters("Update")
dataObj.Submit()
Next
thisXDocument.DOM.selectSingleNode(RPTTBL +
"gprojectid").text = ab
thisXDocument.DOM.selectSingleNode(RPTTBL +
"costcatagory").text = bb
thisXDocument.DOM.selectSingleNode(RPTTBL +
"errordescription").text = gb
thisXDocument.DOM.selectSingleNode(RPTTBL + "resolved").text
= cb
thisXDocument.UI.Alert("Update Successful!!!, Please Click
on Get Listings to return latest changes.")
Catch ex As Exception
Dim strBreak As String = "error"
End Try
End Sub