SQL Trigger when Tendering

Apr 19, 2005 7 Replies

I would like to add a comment to each TransactionEntry record, which would show up on the receipt. Rather than write a DLL, I thought a SQL Trigger would be simple enough. (Yes, I know my way around SQL. :-)



The trigger, itself, seems to work fine. Unfortunately, the comment doesn't show up on the receipt. It does when I add a comment directly at POS, so I know the receipt definition can handle a comment. And after Tendering, the correct value appears in the Comment field of the TransactionEntry table. But it's like the receipt (journal?) image is getting generated before the Transaction is posted. But the documentation says the transation is posted before even any add-in runs.



So, where can I put a SQL trigger that will update the TransactionEntry.Comment field so that it will print on the receipt?



Cheers Dan



No.. because only the primary key ID will get from database into SO Rules..

You have a dll before print the receipt? You can insert the comment into TransactionEntry.Comment before Tender Screen (see doc. for appropriate hook..) and after the POS print receipt with comment.. and post it into journal

bye antonio

My guess is that when POS generates the journal image, it's using it's own copy of the data used to create the transaction entries. So your trigger is modifying the tables properly, but POS is still using it's own internal values, not what got written to the database (this makes sense from a programmers perspecive, why read back the information you just wrote)

I would suggest using an AddItem hook to put the comments in via QSRules

I'm just trying to avoid using a hook. I only have Delphi here, not VB. I wrote a Delphi DLL, but the VB package and the Delphi DLL are not playing nice together. The trigger approach was sooo easy. Too bad it won't work. :-(

The RMS Customization Guide really only says "create a DLL with a 'Process' function, and tell us the dllname and classname." Is there any other documentation, like an SDK, that goes into more detail about HOW the package is making its call to the DLL?

Dan

There's no SDK, just the Customization Guide. I'm not familiar with Delphi, but I assume it has a way of using COM. In VB it's simple because you just create a function called Process. In Delphi, I don't know .. but I imagine it wouldn't be much different.

I would have thought so, too. But one of my buddies knows Delphi and VB better than I do, and he said he's not surprised that there is a communication glitch.

Go to PartnerSource and search for "Customization Guide"

Join the Discussion

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

Didn't find your answer?

Ask the community — no account required