Manual Matching (LETTRAGE) screen - actions are not being called?

SOLVED

Hello,

I want to make a simple specific script modification for the manual matching screen (SPELTR) however, it seems that actions do not work on the screen. The code is as follows:

$ACTION
 Case ACTION
  When "AVANTBOUT" : gosub ZSOLCPT
  When default
 Endcase
Return

$ZSOLCPT
Case BOUT
 When "V" : infbox 'test'
Endcase
Return

However, the result is nothing. When clicking button V ("Search") it should display the infbox with value test.

Since this didn't work, I tried something more simple.

$ACTION
Infbox ACTION
Return

Normally, doing this will cause a popup any time any action occurs. A real pain to click OK 20 times in row. But for screen LETTRAGE (SPELTR) the result of this code is nothing. There are no actions, or at least the SPELTR script is not being called until later. Is there a workaround for this?

Thank you,

Zoey

Top Replies

  •  the AVANTBOUT label is only called when the action associated with the function is type "Object management". Function LETTRAGE is associated with action MTC which is type "Window entry", and…

  • +1
    verified answer

     the AVANTBOUT label is only called when the action associated with the function is type "Object management". Function LETTRAGE is associated with action MTC which is type "Window entry", and as such to add custom code you need add the code onto the SPE on the action. The standard SPE value for action MTC is XWFMTC. Also keep in mind that different action types have different labels being executed, in the event of "Window entry", the label being executed before button code execution is AVANT_BOUT. 

  • 0 in reply to Regard Hulsbos

    Hi  , thank you for clarifying.

    I solved this a little while ago by noticing that after clicking search, the cursor jumps back to the FCY field. I used this to my advantage by calling AV_FCY and if SOLSNS is not null after the search, it updates my custom field ZSOLCPT appropriately.

    Subprog AV_FCY(VALEUR)
    Variable Char    VALEUR()
    If [M:LTR]SOLSNS = 'Credit'
    chgstl [M:LTR]ZSOLCPT with "BACKORANGE"
    [M:LTR]ZSOLCPT = (0 - [M:LTR]SOLCPT)
    Affzo [M:LTR]SOLCPT
    Elsif [M:LTR]SOLSNS = 'Debit'
    chgstl [M:LTR]ZSOLCPT with "BACKGREEN"
    [M:LTR]ZSOLCPT = [M:LTR]SOLCPT
    Affzo [M:LTR]SOLCPT
    Else 
    [M:LTR]ZSOLCPT = [M:LTR]SOLCPT
    chgstl [M:LTR]ZSOLCPT with "NORMAL"
    Affzo [M:LTR]SOLCPT
    Endif
    End