SOPDeleteDocumentType

The code below produces this XML document

<eConnect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SOPDeleteDocumentType>
    <taSopDeleteDocument>
      <SOPTYPE>2</SOPTYPE>
      <SOPNUMBE>ORDST2225</SOPNUMBE>
    </taSopDeleteDocument>
  </SOPDeleteDocumentType>
</eConnect>

    Sub DeleteSopDocument()
 
        Dim strReturnDoc As String = ""
        Try
 
            'declare our eConnect classes
            Dim oeConnectType As New Microsoft.Dynamics.GP.eConnect.Serialization.eConnectType
            Dim oSOPDeleteDocumentType As New Microsoft.Dynamics.GP.eConnect.Serialization.SOPDeleteDocumentType
            'this is the DynDeveloper eConnect class, documented here:
            'http://dyndeveloper.com/thread.aspx?Threadid=1117
            Dim oeConnectFunctions As New eConnect11Lib.GP11.eConnectFunctions("vmGP11""TWO")
 
            'create the document header
            Dim otaSopDeleteDocument As New Microsoft.Dynamics.GP.eConnect.Serialization.taSopDeleteDocument
 
            'populate the header data
            'only the minimum fields are required
            With otaSopDeleteDocument
                .SOPTYPE = 2
                .SOPNUMBE = "ORDST2225"
            End With
 
            'assign the header to the master
            oSOPDeleteDocumentType.taSopDeleteDocument = otaSopDeleteDocument
 
            ReDim Preserve oeConnectType.SOPDeleteDocumentType(0)
            oeConnectType.SOPDeleteDocumentType(0) = oSOPDeleteDocumentType
            strReturnDoc = oeConnectFunctions.CreateTransactionEntity(oeConnectType)
 
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
 
    End Sub

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences