having problems with my customization

I am trying my hand at writing a customization add-in for RMS in VB6. I have used another customization that we already have that works as a template for doing this new one. The new customization is supposed to be triggered by the TenderEnd hook. I have removed the referent to QSrules from the project, compiled it, and registered the DLL file. I have also added the add-in to the registry, to hook 001 (hook 000 is already populated with the information for our first add-in)

When I go into POS and process a transaction, the first add-in works fine. But when we tender the transaction and close the tender screen, the add-in I created is not being invoked. And when I go into the registry editor, the data I entered into hook 001 is no longer there. I have admin rights on my computer, and was able to add the registry information for hook 000, so I'm not sure why I'm having these problems.

Any ideas? Please let me know if you need any more information, of if you would like me to post the code I will - it is a short and fairly simple customization, perhaps there is something wrong w/ my code

thank you, kevin

Reply to
kskinne
Loading thread data ...

Go up one level in the registry and set the hook count to 2.

Also make sure you have admin rights, or you won't be able to save changes to the registry.

Reply to
Glenn Adams [MVP - Retail Mgmt]

Glenn, thanks for the reply - I did forget to change the hook count to 2, oops, so I changed that and now it is not removing my registry information (I do have admin rights on my machine)

However, my add-in is still not being invoked by the TenderEnd hook. I have the the hooktype set to 15, and the parameter set to 1. objectname is tndrdll.tndrPrompt (tndrdll.dll is my DLL file, and tndrPrompt is my class module containing the code I want triggered at the time of tender)

and here is the code I am trying to trigger:

Public Function Process(session As Object) As Boolean On Error Resume Next

'Dim posSession As QSRules.SessionClass Dim posSession As Object Set posSession = session

If posSession.Transaction.Tenders(4).AmountIn > 0 Then glbInputString = vbNullString frmInput.Show 1 If Len(Trim$(glbInputString)) > 0 Then posSession.Transaction.Comment = "Sold to: " & Trim$(glbInputString) End If End If

Process = True

End Function

frmInput is an input form I created in this project to prompt the user to enter a contact name for the transaction when the transaction is charged, whole or in part, to their store account. glbInputString is a global variable I have declared in a separate module.

any idea why this isn't working correctly?

thanks for the help, kevin

Reply to
kskinne

Public Function Process(posSession as QSRules.SessionClass) as Boolean On Error Resume Next

if posSession.Transaction.Tenders(4).AmountIn > 0 Then frmInput.Show 1, Me ' in frmInput.Show please add the event on close and set the value of glbInputString

If Len(Trim$(glbInputString)) > 0 then posSession.Transaction.Comment = "Sold to:" & Trim$(glbInputString) else posSession.Transaction.Comment = "Sold to UNKNOWN" End If

End If

Process = True End Function

.. it's ok

Antonio

Reply to
Antonio Mazzeo

there must be something wrong with my if statement condition's syntax, because I commented out the if statement and recompiled, and the input form opens just as it should without making it's opening dependent upon my condition - is there something wrong with

posSession.Transaction.Tenders(4) > 0

and if so what is the correct syntax then, to test if the store account tender type is greater then zero, or in other words, an amount is being charged on account in the transaction?

thanks, kevin

Reply to
kskinne

Try adding some error handling & debug statements to see what error is occurring.

Maybe Tenders(4).AmountIn would work better.

Reply to
Glenn Adams [MVP - Retail Mgmt]

and why is the board converting my greater than symbol to xml, i.e., ">" after i post - that is not how i have it in my vb project just so you know

thanks, kevin

"ksk> there must be something wrong with my if statement condition's syntax,

Reply to
kskinne

sorry i mistyped in my post, i do have AmountIn as part of my condition, this is what I have:

If posSession.Transaction.Tenders(4).AmountIn > 0

it appears that this condition is evaluating to false even when I put an amount in the store account tender field on the tender screen. any ideas as to why?

thanks, kevin

Reply to
kskinne

try with this code:

Dim t as TenderEntry

Set t = posSession.Transaction.Tenders(4)

' Break point if t.AmountIn > 0..

with visual basic try to debug your code..

antonio

Reply to
Antonio Mazzeo

I can't declare t as TenderEntry because TenderEntry does not appear in the list as a valid type.

I tried

Set t = posSession.Transaction.Tenders(4)

if t.AmountIn > 0 Then glbInputString = vbNullString frmInput.Show 1

and it still doesn't work - it doesn error out on debug and it compiles correctly, it just doesn't bring up the input form like it is supposed to. in other words for some reason the statement doesn't appear to be evaluating to true.

Any other ideas? I really need to get this to work... Is posSession.Transaction.Tenders(4).AmountIn actually the property for something else other than the amount entered in the store account field on the tender screen? All I can think is that maybe I am going the wrong direction with this line of code, but I have no idea for sure...

I've got the customization guide but I feel it leaves a lot to be desired, it is not really helping me at all with this situation in visual basic. Are there any other good coding resources out there for making RMS customizations in VB?

"Ant> >

Reply to
kskinne

sorry.. it's my error. The type is Tender.. posSession.Transaction.Tenders is array of Tender object.

If t is nothing it's possible that the line 'On Error Resume Next' skip the debug message, and the if condition is always false.

It's the fastest environment to write add-in to store operation. In past I wrote add-in by VC++ but it's slow with respect to VB. Tomorrow is Saturday.. if you work you can send me by mail your project.. and I help you in debug phase..

bye antonio

Reply to
Antonio Mazzeo

i tried commenting out the On Error Resume Next line, but that does not fix it.

here is something that is strange. if i just put in:

MsgBox glbTndrAmt > 0

this returns the message "True" when I go to POS and charge a sale. like wise if I put in the code:

MsgBox glbTndrAmt 0 is evaluating correctly now. But for some reason if I place this statement into an IF statement, it is not working.

I appreciate the offer of help - I will put my project into a zip archive and email it to you today, and you can look at it as soon as you have free time. I will be accessing my email all weekend, so let me know if you are able to fix it

Thank you, kevin

Reply to
kskinne

Please re-post your mail because you have forgotten the attachment

antonio

Reply to
Antonio Mazzeo

oops i apologize - i have resent with attachment

Reply to
kskinne

I'm sorry if I reply to newsgroup.. but I tried to write a e-mail, and the server return me a warning message.. (e-mail spam domain)

I try your code, and it's ok! :(

formatting link
is the result... but I haveonly a problem..Do You work with HookType 15 (hooktypeTenderEnd) ?In my current installation the hook type 15 isn't available.. now Iwork with Store Operation 1.08 and I use hook type 0(hooktypePostTransaction).. and it's ok :) Try to change your hook type value..

bye bye antonio

Reply to
Antonio Mazzeo

Antonio, thank you for looking at this for me. i tried changing my hook type to 0 and that doesn't help me. i am using RMS version 1.2.0171, perhaps that is the problem

i do not having any problem invoking the add-in using the hook type 15, i can place just a msgbox in my code, and it pops up when I using this hook type. it is just not working for me when i try to do the IF statement.

any ideas would be greatly appreciated

thank you, kevin

Reply to
kskinne

Antonio thank you for taking a look at my project. i am using RMS version

1.2.0171, i do not know if the hook types are different in your version compared to mine (they must be), but this is what i am using as a guide for hook types: 0 PostTransaction 1 PrintReceipt 2 TenderBegin 3 ExportAccounting 4 AddItem 5 RefreshDisplay 6 InitializeTransaction 7 StartPOS 8 QuitPOS 9 SavePurchaseOrder 10 SaveSupplier 11 SaveCustomer 12 StartManager 13 QuitManager 14 SaveItem 15 TenderEnd

i know these are accurate because i'm using the customization guide for version 1.2. I tried changing the hook type to PostTransaction but it still does not work. I have not had any problem getting the TenderEnd hook type to invoke my add-in - the problem is that my IF statement doesn't appear to be evaluating correctly.

Any help or ideas would be appreciated, thank you

Kevin

Reply to
kskinne

Thank you very much for hooktype code.. my distributor (I'm not a partner of MBS) not send me documentation.. and I work again with doc of quicksell commerce! :/

Today I copy in my pc RMS 1.20.151 (sorry, it's the latest version that I have..) and I try your component ..

Another question: what's your tender 4? I have CASH, BANCOMAT, CREDIT CARD, FIDELITY CARD (customer account), CHECK and other..

You?

bye antonio

p.s. sorry for english :(

Reply to
Antonio Mazzeo

Hi.. I have RMS 1.08 and 1.2.0151 .. I tried with 1.20.0151 and it's run..

Please open the project and rebuild with reference to 1.20.0171 .. I think that in next week my contact in Germany send me the latest version.. (but I'm not sure).. I can't get from internet because I have a slowest connection (GPRS modem.. 50kbps :/ wrong calabria)

If you have problem please write me.. (in newsgroup or email)

from my register:

Hooks.Count = 1 Hooks.000.Caption = "Test" Hooks.000.Description = "Test" Hooks.000.HookType = 15 Hooks.000.ObjectName = TNDRdll.tndrPrompt Hooks.000.Parameter = 1

Please add in Form1.Text1 the KeyDown message with this code..

If KeyCode = 13 Then Command1_Click

bye antonio

Reply to
Antonio Mazzeo

I have a big problem with your mail server.. It think that I'm spammer!!!

Do You have problem If I post the url of your project (source code)?

Antonio

Reply to
Antonio Mazzeo

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.