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 in the LIENS.
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 in the LIENS.
You need to read, try to add after your filter the following line see if that helps.
Read [F:ZITE] First
didn't work...
Hello,
I agree that you need to read the record as well, but maybe it's because of the file handle in OUVRE.
Did you mean to say this instead?
$OUVRE
If clalev([F:ZITE]) : Close Local File ZITMECO[ZITE] : Endif
Local File ZITMECO [ZITE]
Return
already made both of the modifications and still works the same...
When i insert a value, or modify one the value stay in that field even when i change to another product... it looks like is not refreshing...
here is the code ia have now:
$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]) : Close 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
Read [F:ZITE] First
[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
And what version and Patch this is in?
V8.07.04
Hello,
There might be other solutions, but try add below to $LIENS section.
$LIENS
Filter [F:ZITE]
Filter [F:ZITE] Where [F:ZITE]ITMREF=[M:ITF0]ITMREF and [F:ZITE]STOFCY=[M:ITF0]STOFCY
Read [F:ZITE] First
If fstat : RAZ [M:ZITF0] : Endif
Ok... Silly situation...
I was working with eclipse and for some reason he wasn't compiling the SRC. After I try to compilate from X3 it worked fine...
But i still have one problem, the problem is that ZITMECO only have 3 registed products yet, and when i change to a product that isn't in the ZITMECO it stays with the values of the last one...
With this last comand you told me to use isn't there supose to clear the fields on change?weither way this problem can be solved by importing all products with 0 until the final import of data...
Yes the last command, on read , if the product does not exist, FSTAT>0 it will clear the screen.
Yeah but that command doesn't seem to work... if the product doesn't exist the screen values stays the same has the last one...
You are not clearing out the [F:ZITE] Record you should close the file
Close Local File [F:ZITE]
or when you assign the screen fields put it into an
If !fstat Then
.....
endif
Thanks a lot...
Problem solved
Thank you Both... could not manage it on my Own
*Community Hub is the new name for Sage City