Search the GP Tables
Search by TABLE NAME
Search by FIELD NAME
These are our SOP scripts. All of our scripts for Dynamics GP can be found here
DynDeveloper.com

DynDeveloper.com

Table Edits Forum Articles
Table Edits 0 Table Edits 0 Table Edits 0
Sign Up Now!Log In
SteveGray 11/14/2011 10:53:23 AM

eConnect - SOP unit price and extended price not populating

I'm writing an eConnect integration in GP2010 and the SOP unit price and extended price are not populating. I'd like to get them to default from the item/customer setup. 

If I key the document manually in Dynamics, they populate there...


Sub CreateSOPOrder()
    Try
        Dim strSqlServer As String = System.Configuration.ConfigurationManager.AppSettings("SQLServer")
        Dim strDB As String = System.Configuration.ConfigurationManager.AppSettings("Database")
        Dim strDocID As String = System.Configuration.ConfigurationManager.AppSettings("DOCID")
        Dim strLocationCode As String = System.Configuration.ConfigurationManager.AppSettings("3PlLocationCode")
 
        'declare our eConnect classes
        Dim oeConnectType As New Microsoft.Dynamics.GP.eConnect.Serialization.eConnectType
        Dim oSOPTransactionType As New Microsoft.Dynamics.GP.eConnect.Serialization.SOPTransactionType
        Dim oeConnectFunctions As New GP11.eConnectFunctions(strSqlServer, strDB)
 
        'create the document header
        Dim otaSopHdrIvcInsert As New Microsoft.Dynamics.GP.eConnect.Serialization.taSopHdrIvcInsert
 
        'populate the header
        With otaSopHdrIvcInsert
            .SOPTYPE = 2
            .DOCID = strDocID
            .CUSTNMBR = CUSTNMBR
            .BACHNUMB = "WEB" & Now.ToString("yyyyMMdd")
            .DOCDATE = Now.ToShortDateString
            .CSTPONBR = _BEG.PurchaseOrderNumber
            .PRSTADCD = PRSTADCD
            .PRBTADCD = PRSTADCD
            .ReqShipDate = RequestedShipDate
            .LOCNCODE = strLocationCode
        End With
 
        'assign the header to the master
        oSOPTransactionType.taSopHdrIvcInsert = otaSopHdrIvcInsert
        Dim intCurrentLine As Int16 = 0
        'create the document details
        For Each line As PO1 In _lstPO1
            'declare an object for the detail line
            Dim oItemsTaSopLineIvcInsert As New Microsoft.Dynamics.GP.eConnect.Serialization.taSopLineIvcInsert_ItemsTaSopLineIvcInsert
 
            'populate the detail line
            With oItemsTaSopLineIvcInsert
                oItemsTaSopLineIvcInsert.SOPTYPE = 2
                oItemsTaSopLineIvcInsert.ITEMNMBR = line.ITEMNMBR
                oItemsTaSopLineIvcInsert.QUANTITY = line.quantity
                oItemsTaSopLineIvcInsert.CUSTNMBR = CUSTNMBR
                oItemsTaSopLineIvcInsert.DOCDATE = Now.ToShortDateString
                oItemsTaSopLineIvcInsert.LOCNCODE = strLocationCode
                oItemsTaSopLineIvcInsert.INTEGRATIONID = line.Pack
 
                ReDim Preserve oSOPTransactionType.taSopLineIvcInsert_Items(intCurrentLine)
                oSOPTransactionType.taSopLineIvcInsert_Items(intCurrentLine) = oItemsTaSopLineIvcInsert
 
            End With
            intCurrentLine += 1
        Next
 
 
        ReDim Preserve oeConnectType.SOPTransactionType(0)
        oeConnectType.SOPTransactionType(0) = oSOPTransactionType
        Dim strDoc As String = oeConnectFunctions.CreateTransactionEntity(oeConnectType)
 
    Catch ex As Exception
        Throw ex
    End Try
 
End Sub

Version: GP 2010
Section: eConnect








Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables