I need to be able to require a customer when a specific item is being sold. I have successfully created a DLL with vb6 and set the registry to call the DLL on the add item hook.
So far, I can get a messagebox when the customer is blank. So I think I'm pretty close but can't get across the finish line.
Here's what I think I need. How can I determine the transactionentry.item? Can I see other info like the itemlookupcode or department? How can I call the setcustomer function?
Any help appreciated.
Here is my project code
Public Function Process(Session As Object) As Boolean Dim Entry As Object ' Really TransactionEntry Dim xItem As String xItem = "BLANK" 'Check to see if customer is loaded If Not Session.Transaction.Customer.Loaded Then 'Check to see if the item is on "the list" For Each Entry In Session.Transaction.Entries 'This didn't work 'If Entry.Item = 606 Then 'This didn't work Call SetCustomer
MsgBox "Checking item with a blank customer", vbInformation, "ITEM" 'End If Next End If Process = True End Function
I think the add item hook should pass the item but can't find a good reference for this either. I suppose if I had the ID of the item I could do a sql call to determine any other related item data but if it is already exposed in qsrules, no need.