Problem with SessionClass setting to Nothing

Feb 06, 2006 2 Replies

Hi,



I have a TenderEnd hook registered for my RMS. I am getting a reference of SessionClass object through the Process function. But later in my code, the SessionClass object is automatically getting set to Nothing. So one of my call is failing and the Err.Description is "Invalid Procedure call or argument".



Is there any chance that a SessionClass reference can get set to "Nothing". Is there any Timeout for SessionClass.



Public Function Process(objSession As Object) On Error GoTo ERR_HANDLER: // All my code goes here



// The following call fails because objSession is getting set to "Nothing". Call DisplayTransactionDetails(objSession) Process = True ERR_HANDLER: Call MsgBox(Err.Description) End Function



Private Function DisplayTransactionDetails(objSession as QSRules.SessionClass) // Displaying the Amount and others DisplayTransactionDetails = True End Function



Try running this from a custom pos button should get you started: Public Function Process(objSession As Object) As Boolean On Error GoTo ERR_HANDLER: ' All my code goes here ' The following call fails because objSession is getting set to "Nothing". MsgBox objSession.Cashier.Name Dim blnValue As Boolean blnValue = DisplayTransactionDetails(objSession) MsgBox blnValue If blnValue = True Then Process = True Else Process = False End If Exit Function ERR_HANDLER: Call MsgBox(Err.Description) End Function

Private Function DisplayTransactionDetails(displaySession As Object) As Boolean ' Displaying the Amount and others MsgBox ("The current cashier is" & displaySession.Cashier.Name & ".") DisplayTransactionDetails = True End Function

Rob

"harshalenator" wrote:

Thank you very much Rob,

But my concern is why the SessionClass object is getting set to "Nothing"? Did anyone had this problem before?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required