nProcessReport returns Nothing

SOLVED

Hi, 

I have the code below for automatic registration/update of the inventory register transactions.

In the nProcessReport part, my return is always Nothing. I'm encountering same issue on Sage 100 2018 and 2020

oSSRegister.nSetProgram(oSSRegister.nLookupTask("IM_TransactionRegister_UI"))
objRegister = oScript.NewObject("IM_TransactionRegister_UPD", oSSRegister)

oSSRegister.nTerminateUI()

objRegister.nPopulateWorkTable()
objRegister.nSetPostingDate(Now().ToString("yyyyMMdd"))

retVal = objRegister.nInitReportEngine()
retVal = objRegister.nProcessReport("deferred")
retVal = objRegister.nUpdateInit()
retVal = objRegister.nUpdateMain()
retVal = objRegister.nUpdateCleanup()

objRegister.DropObject()
oSSRegister.DropObject()

Any help will be greatly appreciated.

Thank you.

Parents
  • 0
    SUGGESTED

    I don't use deferred but looking at one of my scripts, the key points were in the following order;

    1. SelectBatch (if batch if batching is enabled)
    2. SetPostingDate (i just pass it the session object's SystemDate property which is already in YYYYMMDD format)
    3. InitReportEngine
    4. ProcessReport
    5. UpdateInit
    6. UpdateMain

    Different update objects sometime vary and that might make UpdateCleanup needed. 

    The one thing you'll likely need to do is output the retVal and objRegister.sLastErrorMsg to either a message box or a log file so you can see if an error is being returned.  You should also set the sLastErrorMsg property to a blank string before you call each method that you need to trap so you aren't seeing an error that was set my an earlier method.  You could also use If statements on the retVal values so you only proceed to the next point if the previous point succeeded instead of trudging through them all without regard for possible errors.

    Also, make sure you covered the steps in this post if on an applicable version.

    https://www.sagecity.com/support_communities/sage100_erp/f/sage-100-business-object-interface/150252/sales-order-printing-via-boi-in-sage-100/393580#393580 

Reply
  • 0
    SUGGESTED

    I don't use deferred but looking at one of my scripts, the key points were in the following order;

    1. SelectBatch (if batch if batching is enabled)
    2. SetPostingDate (i just pass it the session object's SystemDate property which is already in YYYYMMDD format)
    3. InitReportEngine
    4. ProcessReport
    5. UpdateInit
    6. UpdateMain

    Different update objects sometime vary and that might make UpdateCleanup needed. 

    The one thing you'll likely need to do is output the retVal and objRegister.sLastErrorMsg to either a message box or a log file so you can see if an error is being returned.  You should also set the sLastErrorMsg property to a blank string before you call each method that you need to trap so you aren't seeing an error that was set my an earlier method.  You could also use If statements on the retVal values so you only proceed to the next point if the previous point succeeded instead of trudging through them all without regard for possible errors.

    Also, make sure you covered the steps in this post if on an applicable version.

    https://www.sagecity.com/support_communities/sage100_erp/f/sage-100-business-object-interface/150252/sales-order-printing-via-boi-in-sage-100/393580#393580 

Children