hi
Can anyone please tell me what is wrong with my code? I have added a button to the Jnl Entry window which fires off an action with 2 parameters attached: JOURNAL being Journal Type [M:HAE0]TYP and VCRNUM being journal Number [M:HAE0]NUM. The SPE for this action is as follows
$ACTION
Case ACTION
When "OUVRE" : Gosub OUVRE
When "DEBUT" : Gosub DEBUT
When "BOUTON" : Gosub BOUTON
Endcase
Return
$OUVRE
If !clalev([F:YHAE])
Local File GACCENTRY [F:YHAE]
Endif
Return
$DEBUT
Read [F:YHAE]HAE0=PARAM(1)(2)
If !fstat
[M:YUGS]STA=[F:YHAE]STA
[M:YUGS]TYP=[F:YHAE]TYP
[M:YUGS]NUM=[F:YHAE]NUM
Affzo [M:YUGS]
Else
FIN=1
Endif
Return
$BOUTON
If BOUT='z'
Local Integer SUCCESS
Trbegin [YHAE]
Readlock [F:YHAE]HAE0=PARAM(1)(2)
If !fstat
[F:YHAE]STA = [M:YUGS]STA
Rewrite [F:YHAE]
If !fstat
SUCCESS=1
ELSe
SUCCESS=0
Endif
Else
SUCCESS=0
Endif
If SUCCESS=1
Commit
FIN=1
Else
Rollback
Infbox('Update failed with status of'-num$(fstat))
Endif
Endif
Return
When I click on the button, I get bombed out of the screen
Thanks