Hi everyone, I had written the following code a long time ago to extract the form name on load. The code was written in VB for Infopath 2003.
I need to do the same thing for Infopath 2007 now and in C# Can you please help me translate the following code:
Dim flag As Boolean flag = thisXDocument.IsNew
If Not flag Then
Dim Submit As DAVAdapter
Submit = thisXDocument.DataAdapters.Item("LFPM tracker")
If thisXDocument.URI.StartsWith(Submit.FolderURL) Then
thisFilename = thisXDocument.URI.Substring(Submit.FolderURL.Length + 1)
End If
PCCBNode = thisXDocument.DOM.documentElement.selectSingleNode("/my:myFields/my:PCCBFLag")
Dim xmlNode As IXMLDOMNode
xmlNode = thisXDocument.DOM.documentElement.selectSingleNode("/my:myFields/my:strFilename")
xmlNode.text = thisFilename
If (thisFilename = "") Then
Dim xmlNode1 As IXMLDOMNode
xmlNode1 = thisXDocument.DOM.documentElement.selectSingleNode("/my:myFields/my:ReadonlyFlag")
xmlNode1.text = "true"
thisXDocument.ViewInfos("Error").IsDefault = True
End If
End If
e.ReturnStatus = True
Any help will be much appreciated