Getting Cashier ID as 0

Mar 24, 2006 1 Replies

I am getting cashier Id as 0 everytime ?? I am trying to display the Cashier Id on message box and everytime its displaying 0



Following is the code that I have used... It always goes to Else condition and displays 0....



Hook Type was 2 i.e TenderBegin



Public Function Process(Optional mySession As Object) As Boolean Set mySession = CreateObject("QSRules.SessionClass") If mySession.Cashier.ID = 1 Then MsgBox (mySession.Cashier.FirstName) Else MsgBox ("Id is not know" & mySession.Cashier.ID) End If End Function



Please Help me... Waiting for ur reply... :-(



Vicky...:-)


Try getting rid of the line that obliterates the session object that is passed into your function:-

Public Function Process(mySession As Object) As Boolean If mySession.Cashier.ID = 1 Then MsgBox (mySession.Cashier.FirstName) Else MsgBox ("Id is not know" & mySession.Cashier.ID) End If End Function

If you want to save a reference to the session object for use elsewhere, try:-

'Dim g_objSession as Object 'Comment this line for debug Dim g_objSession as QSRules.SessionClass ' Comment this line for release

Public Function Process(mySession As Object) As Boolean Set g_objSession = mySession

If g_objSession.Cashier.ID = 1 Then MsgBox (g_objSession.Cashier.FirstName) Else MsgBox ("Id is not know" & g_objSession.Cashier.ID) End If End Function

Join the Discussion

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

Didn't find your answer?

Ask the community — no account required