edit a record with tdatabase - I am in trouble
Posted: Fri Jun 18, 2021 7:58 am
I state I can not use an xbrowse to get the record so I have to search the archive first before to make the modify
I select an obtn where I save a cargo with many info
local cNumPre :=oBtn:cargo[28]
//open the database and order on Invoice number
oReserva:=Tdatabase():Open(,::cDbfPath + "Reserva" ,"DBFCDX", .t.)
oReserva:setOrder("res_pre" ) // field invoice ( string 16 cr)
nInvoice:= ALLTRIM(cNumPre) I havethis infor from oBtn:cargo
If oReserva:seek(nInvoice) //search
//here i must create the record
oPrenota:= :=oReserva:record() // it is sure I stay on the same record of the invoice ?
else
Msginfo("invoice not found")
return nil
Endif
I tried and allway return error not found
I select an obtn where I save a cargo with many info
local cNumPre :=oBtn:cargo[28]
//open the database and order on Invoice number
oReserva:=Tdatabase():Open(,::cDbfPath + "Reserva" ,"DBFCDX", .t.)
oReserva:setOrder("res_pre" ) // field invoice ( string 16 cr)
nInvoice:= ALLTRIM(cNumPre) I havethis infor from oBtn:cargo
If oReserva:seek(nInvoice) //search
//here i must create the record
oPrenota:= :=oReserva:record() // it is sure I stay on the same record of the invoice ?
else
Msginfo("invoice not found")
return nil
Endif
I tried and allway return error not found