Method :EditBaseRecord

Method :EditBaseRecord

Postby oliveiros junior » Wed Dec 27, 2017 5:08 pm

Hello,

I am with a doubt as to the use of the method: EditBaseRecord, if in the rowset I put "* " The method works, if specified the field in the rowset does not work. Shouldn't he use all the fields in the rowset independent table?

Example: Doesn't work

oTabela: = oCon: RowSet ( "SELECT codigo, descricao FROM ocorrencia")

DEFINE VMENUITEM the item OF omenu;
IMAGE "";
CAPTION "incluir ";
ACTION (oTabela: EditBaseRecord (NIL,. T., {| oRec | Editar_Tabela (ORec, CTabela)}, OBrowse);
oTabela: Rewanty (),;
oBrowse: SetFocus ())

Example: works

oTabela: = oCon: RowSet ( "SELECT * FROM ocorrencia")

DEFINE VMENUITEM the item OF omenu;
IMAGE "";
CAPTION "incluir ";
ACTION (oTabela: EditBaseRecord (NIL,. T., {| oRec | Editar_Tabela (ORec, CTabela)}, OBrowse);
oTabela: Rewanty (),;
oBrowse: SetFocus ())

Did I misunderstand the operation of the method?

Att.,

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Method :EditBaseRecord

Postby nageswaragunupudi » Thu Dec 28, 2017 3:37 am

Code: Select all  Expand view  RUN

oTabela:Rewanty()
 

What is the method "Rewanty()" please? There is no such method. Did you mean ReQuery() ?
If you are using Requery(), that is not necessary. Requery() is time cosuming and slows down the process.
oRec:Save() automatically takes care of refreshing the rowset with the changed values.

Code: Select all  Expand view  RUN

oTabela: = oCon: RowSet ( "SELECT * FROM ocorrencia")
 

When you read all fields of the table, EditBaseRecord() is not necessary. oTabela:Edit() is enough.

Code: Select all  Expand view  RUN

oTabela: = oCon: RowSet ( "SELECT codigo, descricao FROM ocorrencia")
 

The method EditBaseRecord() is meant to work in such cases only.
But there are two important condtions:
1) The table should have a primary key.
2) The primary key field should be included in the SELECT Query.

If you ensure that these 2 conditions are satisfied, EditBaseRecord() works.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Method :EditBaseRecord

Postby oliveiros junior » Thu Dec 28, 2017 7:44 pm

Hello Mr. Rao,

Thanks for the answer. "Rewanty () " was the translator.

I'll make the indicated changes and return here. Thanks again.

Att.,

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm

Re: Method :EditBaseRecord

Postby oliveiros junior » Fri Dec 29, 2017 9:04 pm

Hello Mr. Rao,

It worked perfectly. Instead of Edit () I used EditSource () to create my own screens.

I wonder if when executing an ReQuery() empty the class performs the initial query again?

Att.,

Oliveiros Junior
oliveiros junior
 
Posts: 125
Joined: Tue Mar 20, 2007 3:13 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 62 guests