Skip to Content
Author's profile photo Mahendrakumar Phadtare

How to Load Form With Multiple Instances in SAP Business One? To Avoid “Form Already Exist Error”

Hello All,

Greetings !!!

Kindly Find the attached code to Load Multiple instances of Same form in SAP Business One to Avoid “Form Already Exist Error”.

#Region "Load Form"
    'To Load Form in SAP Business One
    Sub LoadForm(ByVal XMLFile As String, ByVal FormType As String, ByVal FormUID As String, Optional ByVal FileType As ResourceType = ResourceType.Content)
            Dim xmldoc As New Xml.XmlDocument
            Dim Streaming As System.IO.Stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Simple_Form." + XMLFile)
            Dim StreamRead As New System.IO.StreamReader(Streaming, True)
            Dim r As New Random
            If Not xmldoc.SelectSingleNode("//form") Is Nothing Then
                xmldoc.SelectSingleNode("//form").Attributes.GetNamedItem("uid").Value = xmldoc.SelectSingleNode("//form").Attributes.GetNamedItem("uid").Value & "_" & r.Next
            End If
        Catch ex As Exception
        End Try
    End Sub
#End Region


Thanks and Regards,




Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.