Quantcast
Channel: Latest Posts
Viewing all articles
Browse latest Browse all 6482

Writing a script to confirm 'CARD' key

$
0
0

Hi there,

 

Basic gist - I'm trying to use ETAL to provide a check-box when our customer presses the CARD key, it should come up with an "Are you sure?" / Yes / No box.

 

I know I could just change the language.def file

122=40=YOU HAVE A CHECK OPEN, CONTINUE?

to reflect this, but there may be instances when they want to keep that warning as well as wanting to make sure that a card payment (tendering not compulsory) has been pressed correctly.

 

The script I've got is

function BeforeKeyPress(nFile, nRecord, nKeyType)
{
    if(nFile == 51 && nRecord == 3) // have they pressed the CARD status key
    {
        local nResult = ICR_MessageBox("Are you sure this is a CARD payment?", "", "Check", 1);
        if (nResult)
           return true;
       else
          return false;
    }
}

It seems to work perfectly, but ... in the output.txt I get the following every time I use it and press the "YES" option.  Nothing appears in the log if I press "NO".

21/05/2016 16:50.32 INCORRECT TYPE, RETURN VAL (WANTED BOOL)
21/05/2016 16:50.33 INCORRECT TYPE, RETURN VAL (WANTED BOOL)
21/05/2016 16:50.34 INCORRECT TYPE, RETURN VAL (WANTED BOOL)
21/05/2016 16:50.34 INCORRECT TYPE, RETURN VAL (WANTED BOOL)

Viewing all articles
Browse latest Browse all 6482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>