check existing first and last on customer - RESOLVED !!!
Posted: Mon Jun 14, 2021 10:02 am
when I add a record I encounter difficulties because the customer archive is not indexed on first and last
I must make a check if the first and last exist
and on the network I cannot make an index on the fly
so if I check the First or the Last it tells me that it is already existing
the problem is that I can have customers who have the same First and also the same Last so how can I check
how can i do this check and see that the name entered is already in the archive?
I state I'm using tdatabase and I use customer dbf
oDbf:SetOrder( 1 ) //FIRST
oDbf:GoTop()
if oDbf:Seek( UPPER( cFirst) )
this give me the user is allready on archive
if I make oDbf:Seek( UPPER( cFirst+cLast) ) I not have the index
I made a test making an index on first+last
then i made
local cNomeIntero :=alltrim(cFirst) +alltrim(cLast)
oDbf:SetOrder( 16 ) //first+last
oDbf:GoTop()
oDbf:Seek( UPPER( cNomeIntero ) )
xbrowser oDbf
not good it go to eof of dbf and give me not return if found the record
any solution ?
I must make a check if the first and last exist
and on the network I cannot make an index on the fly
so if I check the First or the Last it tells me that it is already existing
the problem is that I can have customers who have the same First and also the same Last so how can I check
how can i do this check and see that the name entered is already in the archive?
I state I'm using tdatabase and I use customer dbf
oDbf:SetOrder( 1 ) //FIRST
oDbf:GoTop()
if oDbf:Seek( UPPER( cFirst) )
this give me the user is allready on archive
if I make oDbf:Seek( UPPER( cFirst+cLast) ) I not have the index
I made a test making an index on first+last
then i made
local cNomeIntero :=alltrim(cFirst) +alltrim(cLast)
oDbf:SetOrder( 16 ) //first+last
oDbf:GoTop()
oDbf:Seek( UPPER( cNomeIntero ) )
xbrowser oDbf
not good it go to eof of dbf and give me not return if found the record
any solution ?