BOI into AR_InvoiceHistoryTracking_BUS

I'm not getting an error message but it is not importing.  I'm I using the correct program?  I thought it might be the nsetnewkey issue.  Are any of you importing directly into the history?

 

retval = oSS.nSetDate("A/R", "20130101")

retval = oSS.nSetModule("A/R")

retval = oSS.nSetProgram(oSS.nLookupTask("AR_InvoiceHistoryInquiry_UI"))

Set oTrackingBus = oScript.NewObject("AR_InvoiceHistoryTracking_BUS", oSS)

 

Dim testkey
            testkey = invoiceno + "000000" + "0001"
           
        retval = oTrackingBus.nsetnewkey(testkey)
        retval = oTrackingBus.nsetvalue("InvoiceNo$", invoiceno)
        retval = oTrackingBus.nsetvalue("HeaderSeqNo$", "000000")
        retval = oTrackingBus.nsetvalue("TrackingID$", trackno)
        retval = oTrackingBus.nsetvalue("PackageNo$", "0001")
        retval = oTrackingBus.nsetvalue("Comment$", comment)
        retval = oTrackingBus.nsetvalue("StarshipShipvia$", carrier)
        retval = oTrackingBus.nsetvalue("Weight", weight)
        retval = oTrackingBus.nsetvalue("FreightAmt", packagecost)
        retval = oTrackingBus.nsetvalue("FreightAmtAddedToInv", packagecost)
        retval = oTrackingBus.nwrite

Parents Reply Children
  • in reply to jryals

    I am able to write to AR_InvoiceHistoryTracking.  The task you use to set security is an inquiry task which doesn't allow adding new record.  I  use a data entry task.  You can check sLastErrorMsg when retVal is 0 to see what fails.

    retVal = oSS.nSetUser("NC","")

    retVal = oSS.nSetCompany("ABC")

    retVal = oSS.nSetDate("A/R","20141231")

    retVal = oSS.nSetModule("A/R")

    retVal = oSS.nSetProgram(oSS.nLookupTask("AR_INVOICE_UI"))

    Set oTrackingBus = oScript.NewObject("AR_InvoiceHistoryTracking_bus",oSS)

    retVal = oTrackingBus.nSetKeyValue("InvoiceNo$","0100067")

    retVal = oTrackingBus.nsetKeyValue("HeaderSeqNo$", "000000")

    retVal = oTrackingBus.nSetKeyValue("PackageNo$","0001")

    retVal = oTrackingBus.nSetKey()

    if retVal = 2 then

    retVal = oTrackingBus.nSetValue("TrackingID$","1234567890")

    retVal = oTrackingBus.nSetValue("Comment$","TEST") ' doesn't work

    retVal = oTrackingBus.nWrite()

    if retVal <> 1 then

    msgbox oTrackingBus.sLastErrorMsg

    end if

    end if

    I found a problem in the code which prevented the Comment from being set.  We will fix it in the next version (2016).  If you need it fixed in an earlier version, please contact Sage support.

  • in reply to Natasha Chang

    I'll give it try and let you know.

    Thanks