Hi there can anyone help me in Sage X3.
I made a new table (ZITEMECO) and a new screen (ZITF0) to use inside OITF window but I'm having trouble to read the table, it appears that $LIENS action not working at all, what am I doing wrong?
Here is the code of the SPEITF:
# Gestão da máscara ITF0 (Específico)
$ACTION
Case ACTION
When "OUVRE" : Gosub OUVRE
When "APRES_CRE" : Gosub APRES_CRE
When "APRES_MOD" : Gosub APRES_MOD
When "LIENS" : Gosub LIENS
When Default
Endcase
Return
$OUVRE
If clalev([F:ZITE]) : Local File ZITMECO[ZITE] : Endif
Local File ZITMECO [ZITE]
Return
$APRES_CRE
Gosub APRES_CRE_MOD
Return
$APRES_MOD
Gosub APRES_CRE_MOD
Return
$APRES_CRE_MOD
Local Integer LN_EXISTE
LN_EXISTE=1
Read [ZITE]ZITE0=[M:ITF0]ITMREF;[M:ITF0]STOFCY
If fstat=0
LN_EXISTE=2
Else
LN_EXISTE=1
Endif
Trbegin[F:ZITE]
[F:ZITE]ITMREF=[M:ITF0]ITMREF
[F:ZITE]STOFCY=[M:ITF0]STOFCY
[F:ZITE]VIDRO=[M:ZITF0]VIDRO
[F:ZITE]PLASTICO=[M:ZITF0]PLASTICO
[F:ZITE]PAPEL=[M:ZITF0]PAPEL
[F:ZITE]ECAL=[M:ZITF0]ECAL
[F:ZITE]ACO=[M:ZITF0]ACO
[F:ZITE]ALUM=[M:ZITF0]ALUM
[F:ZITE]MADEIRA=[M:ZITF0]MADEIRA
[F:ZITE]OUTROS=[M:ZITF0]OUTROS
If LN_EXISTE=2
Rewrite [F:ZITE]
Else
Write [F:ZITE]
Endif
If fstat=0
Commit
Else
Rollback
Endif
Return
$LIENS
Filter [F:ZITE]
Filter [F:ZITE] Where [F:ZITE]ITMREF=[M:ITF0]ITMREF and [F:ZITE]STOFCY=[M:ITF0]STOFCY
[M:ZITF0]VIDRO=[F:ZITE]VIDRO
[M:ZITF0]PLASTICO=[F:ZITE]PLASTICO
[M:ZITF0]PAPEL=[F:ZITE]PAPEL
[M:ZITF0]ECAL=[F:ZITE]ECAL
[M:ZITF0]ACO=[F:ZITE]ACO
[M:ZITF0]ALUM=[F:ZITE]ALUM
[M:ZITF0]MADEIRA=[F:ZITE]MADEIRA
[M:ZITF0]OUTROS=[F:ZITE]OUTROS
Affzo [M:ZITF0]
Return
If anyone can help me, I'm stuck in this... I can write the values in the table and modify them but I'm not able to read them.
There's no read in your $LIENS
block. The filter statement just filter. You have to add a for [F:ZITE] ... next
or a Read [F:ZITE]
last or first or read [F:ZITE]ZITE0=[M:ITF0]ITMREF;[M:ITF0]STOFCY