I'm trying to delete un needed rows in a form before the data is pushed to a separate sharepoint list. I'm getting an error that states, "A calculation in the form has not been completed. The number of calculations used for a single action exceeded the maximum limit." I can't figure out what is causing the issues. Here is my code. If anyone has any ideas, I would be eternally grateful!
EDIT: I've just noticed that error is thrown when this line is executing = oParentNode.removeChild(node) but the error occurs at irregular intervals as far as I can tell. It's not consistent.
thisXDocument.View.DisableAutoUpdate()
Dim oParentNode As IXMLDOMNode
oParentNode = thisXDocument.DOM.selectSingleNode("//my:myFields")
Dim numRows As Integer = thisXDocument.DOM.selectNodes("//my:myFields/my:MovementDetail").length
Dim last As Integer
Dim node As IXMLDOMNode
Dim status As String
Dim i As Integer
For i = 1 To numRows
last = thisXDocument.DOM.selectNodes("my:myFields/my:MovementDetail").length
If i > last Then
Exit Sub
End If
node = thisXDocument.DOM.selectSingleNode("//my:myFields/my:MovementDetail[" & i & "]")
status = thisXDocument.DOM.selectSingleNode("//my:myFields/my:MovementDetail[" & i & "]/my:MovementType").text
If status = "0" Then
oParentNode.removeChild(node)
numRows = numRows - 1
i = i - 1
End If
Next
thisXDocument.View.EnableAutoUpdate()