Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Tue Jun 02, 2020 9:26 pm

buenas tengo este problema con la nativa,

https://drive.google.com/file/d/1r96D4lOEKS2j84Dpk0e0Ql8Px0ggD6JJ/view?usp=sharing

adjunto video con el problema. Gracias.
Saludos.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby acuellar » Wed Jun 03, 2020 11:26 am

Estimado Ariel

Físicamente lo está grabando doble en la tabla?
O solo lo está mostrando doble?

Porque si sólo lo está mostrando quizás tenga que refrescar el browse.
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1593
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Thu Jun 04, 2020 2:20 pm

ACuellar, gracias por contestar

si te fijas el video cuando refiltro desde SetFilterRegistro( oBrw ) se arregla.

Saludos.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Thu Jun 04, 2020 3:48 pm

x las dudas pego codigo :

Code: Select all  Expand view

/*
   Duplicación de registro en xBrowse
   luego de Agregar o Editar.
*/


// SELECT de Tabla

   oQryBD:= ::oConn:RowSet( "SELECT * FROM clientes " + ;
                            "LEFT JOIN conceptos AS CONC ON CONC.idConcep = clientes.idConcep " + ;
                            "LEFT JOIN servicios AS SERV ON SERV.idService = clientes.idService " + ;
                            "WHERE NumeroDocumento LIKE ? and Apellidos LIKE ? and Nombres LIKE ? " + ;
                            "ORDER BY Apellidos", ;
                            { ::cDocumento, ::cApellido, ::cNombre } )

// xBrowse
   REDEFINE XBROWSE aO[_oBrw] ID BRW_XBRW OF oDlg AUTOSORT ;
            COLUMNS "NumeroDocumento", "Apellidos", "Nombres" ;
            HEADERS "DCTO",            "Apellidos", "Nombres" ;
            OBJECT ::oQryCli

   WITH OBJECT aO[_oBrw]
      :nColDividerStyle   := LINESTYLE_DARKGRAY       // Linea Tipo
      :l2013              := TRUE
      :nStretchCol        := STRETCHCOL_LAST
      :nMarqueeStyle      := MARQSTYLE_HIGHLROWRC     // linea señaladora
      :lColDividerComplete:= TRUE                     // Linea de columna hasta final de Brw
      :lAllowColHiding    := FALSE                    // Anular menu pop Ocultar/Mostrar columna
      :lHScroll           := FALSE
      :lMultiselect       := FALSE                    // Cuando repsoiciona por busqueda cambia la barra de señalizacion

      :SetColor( CLR_BLACK, CLR_BACKAMAR )            // colorea todo el browse
      :bClrStd:= {|| {CLR_BLACK, CLR_BACKAMAR} }
      :oHeaderFonts:= oSelf:oRutG:hFont["Calibri14"]

      // Get de Cabecera
      :lGetBar   := .T.
      :bClrEdits := { || { CLR_BLACK, CLR_BACKBLUE1 } }

      :bLDblClick:= {|| Eval( aO[_oBrw]:bKeyDown, VK_F12 ) }    //
      :bKeyDown  := {|nK| if( nK==VK_F12, if( lCaptura, ( Eval( bRetorno ), ( aO[_oBrw]:End(), oDlg:End(), ::oRutG:EndFont() ) ), ), ) }

      // Menu Hamburguesa
      :nRecSelHeadBmpNo := { 48, 48, { { "L", 0, 2, 16, 16, 2, 1, 2, 14 }, ;
                                       { "L", 0, 2, 16, 16, 7, 1, 7, 14 }, ;
                                       { "L", 0, 2, 16, 16,12, 1,12, 14 } } }
      :bRecSelHeader:= "Menú"
      :bRecSelClick := {|| ::MenuH( aO[_oBrw], oDlg, _MNCLIENTES,, lCaptura ) }          // Menu de opciones

      // PopUp
      :bRClicked:= {|nRow, nCol| if( !lCaptura, ::PopMenu( aO[_oBrw], lCaptura, nRow, nCol ), msgBeep() ) }
   END

   WITH OBJECT aO[_oBrw]:DCTO
      :cHeader:= "Dcto N°"
      :nWidth := 110
      //:cEditPicture:= PIC_DNI
      :bStrData:= {|| Transform( ::oQryCli:NumeroDocumento, if( IsDigit(::oQryCli:NumeroDocumento) .and. Val(::oQryCli:NumeroDocumento)<= 99999999, ;
                                                              "@R 99.999.999", ;
                                                              if( !IsDigit(::oQryCli:NumeroDocumento), "@!", "@R 99.999.999" )) ) }

      :Cargo:= "NumeroDocumento"
      :bBarGetAction:= {|| ::SetFilterRegistro( aO[_oBrw], lCaptura ) }
   END
   WITH OBJECT aO[_oBrw]:Apellidos
      :cHeader:= if(lCaptura, "Raz.Social", "Apellidos" )
      :nWidth := if( lCaptura, 300, 260 )

      :Cargo:= if( lCaptura, "RAZSOC", "Apellidos" )
      :bBarGetAction:= {|| ::SetFilterRegistro( aO[_oBrw], lCaptura ) }
      :cBarGetPic:= "@!"
   END
   WITH OBJECT aO[_oBrw]:aCols[3]
      :cHeader:= if(lCaptura, "", "Nombres" )
      :nWidth := 1

      if !lCaptura
         :Cargo:= "Nombres"
         :bBarGetAction:= {|| ::SetFilterRegistro( aO[_oBrw] ) }
         :cBarGetPic:= "@!"
      end
   END

   // Default
   aEval( aO[_oBrw]:aCols, { |o,n| IF(o:cargo <> Nil, ( o:uBarGetVal  := if( n == 1 .and. !Empty( Token( ::cDocumento,"%" ) ), Token( ::cDocumento,"%" ), ;
                                                                         if( n == 2 .and. !Empty( Token( ::cApellido,"%" ) ),  Token( ::cApellido,"%" ), ;
                                                                         if( n == 3 .and. !Empty( Token( ::cNombre,"%" ) ),    Token( ::cNombre,"%" ), Space( 50 ) ))), ; // o:uBarGetVal:= uValBlank( ::oQryCli:FieldGet( n ) ), ;
                                                        o:cBarGetBmp  := "bmp_Buscar (24x24)", ;
                                                        o:bBarGetValid:= {|| ::SetFilterRegistro( aO[_oBrw], lCaptura ) } ), ) } )

   ...
// Finb xBrowse

//     Menu
METHOD MenuH( oBrw, oDlg, nOpcion, nFolder, lCaptura )  CLASS TBDatos
local oMenu

   MENU oMenu POPUP 2015
         MENUITEM "Agrega" ;
         RESOURCE "bmp_AgrCli (20x20)" ;   // EditBaseRecord( [cFieldList], [lNew], [bEdit], [oBrw], [lLock] )
         ACTION   ::oQryCli:EditBaseRecord( nil, TRUE, { |oRec| ::AgrEdiCliente( oRec, oBrw ) }, oBrw )        // <--- QUE HACE ESTE oBrw

         MENUITEM "Edita" ;
         RESOURCE "bmp_EdiCli (20x20)" ;
         WHEN     !::oQryCli:RecCount() == 0 ;
         ACTION   ::oQryCli:EditBaseRecord( nil, FALSE, { |oRec| ::AgrEdiCliente( oRec, oBrw ) }, oBrw, TRUE ) // <--- QUE HACE ESTE .T.

         MENUITEM "Cierra Tabla" ;
         RESOURCE "bmp_Salir (20x20)"  ;
         ACTION   oDlg:End()
   ENDMENU

   return( oMenu )
// Fin


// Evento Guardar

   REDEFINE RBBTN ID BTN_GUARDAR OF oDlg TRANSPARENT ;
            PROMPT "Guardar" LEFT ;
            BITMAP "bmp_Guardar (28x28)" ;
            LINECOLORS CLR_BLUE, CLR_HBLUE ;
            ACTION ( oCliente:idConcep := hServicios["idConcepto"], ;
                     oCliente:idService:= hServicios["idService"], ;
                     if( oSelf:GuardaCliente( oCliente, lAgrega ), ;
                         ( oSelf:cDocumento:= ;
                           oSelf:cApellido := ;
                           oSelf:cNombre   := "", ;
                           oSelf:SetFilterRegistro( oBrw ), ;                       // Re Filtra el Browse - mostrando toda la Tabla
                           if( lAgrega, ;
                               ( oSelf:oQryCli:SetOrder( "Apellidos" ), ;           // Posiciona la barra en el registro Agregado
                                 oSelf:oQryCli:GoTop(), ;
                                 oSelf:oQryCli:Seek( RTrim(oCliente:Apellidos) ) ), ), ;
                           oDlg:End(), ;
                           oBrw:SetFocus() ), ;
                         msgBeep() ) ) )

   ...
// Fin Dialog Agrega/Edita

// Consultas Filtradas
METHOD SetFilterRegistro( oBrw, lCaptura ) CLASS TBDatos
 local oCol, ;
       uVal, ;
       uValFil:={}

   DEFAULT lCaptura:= FALSE

   FOR EACH oCol IN oBrw:aCols
       uVal := oCol:uBarGetVal

       if ValType(uVal)=="C"
          aAdd( uValFil, AllTrim( uVal ) )
       elseIf ValType(uVal)=="N"
          aAdd( uValFil, Str( uVal ) )
       elseIf ValType(uVal)=="D"
          // PENDIENTE
       end
   NEXT

   if Len(uValFil) > 0
      ::cDocumento:= if( ::nOpcFil == _QCOMIENCE, '', '%') +uValFil[1]+'%'    //, ;
      ::cApellido := if( ::nOpcFil == _QCOMIENCE, '', '%') +uValFil[2]+'%'    //, ;
      if !lCaptura
         ::cNombre   := if( ::nOpcFil == _QCOMIENCE, '', '%') +uValFil[3]+'%'
      end

      if !Empty( ::oQryCli )
         if lCaptura
            ::oQryCli:Requery( { ::cDocumento, ::cApellido } )
         else
            ::oQryCli:Requery( { ::cDocumento, ::cApellido, ::cNombre } )
         end
         ::oQryCli:Refresh()
      end
      oBrw:Refresh()
   end

   oBrw:SetFocus()

   return( TRUE )
// Fin


 


Gracias.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby leandro » Thu Jun 04, 2020 7:28 pm

En algún momento me sucedió lo mismo, y creo que el tema pasa mas por la forma como esta definida la consulta, desde mi punto de vista, debe quedar la siguiente manera:

Code: Select all  Expand view

//hace falta el paréntesis
oQryBD:= ::oConn:RowSet( "SELECT * FROM (clientes " + ;
                            "LEFT JOIN conceptos AS CONC ON CONC.idConcep = clientes.idConcep) " + ;
                            "LEFT JOIN servicios AS SERV ON SERV.idService = clientes.idService " + ;
                            "WHERE NumeroDocumento LIKE ? and Apellidos LIKE ? and Nombres LIKE ? " + ;
                            "ORDER BY Apellidos", ;
                            { ::cDocumento, ::cApellido, ::cNombre } )
 
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1481
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby nageswaragunupudi » Fri Jun 05, 2020 3:43 am

1) Can you please clarify whether the table `clientes` has a primary key? If so, what is the name of the field? Is it autoincrement or manual key?
2) Though you joined the tables `conceptos` and `servicios`, you did not inclued any field from these tables in the SELECT statement. Therefore, you need not join the tables. Can you please try the same examples without joining these tables?

Proposed SQL:
Code: Select all  Expand view

   oQryBD:= ::oConn:RowSet( "SELECT * FROM clientes " + ;
                            "WHERE NumeroDocumento LIKE ? and Apellidos LIKE ? and Nombres LIKE ? " + ;
                            "ORDER BY Apellidos", ;
                            { ::cDocumento, ::cApellido, ::cNombre } )
 

Do you get the same problem with this also?
Regards

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

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Tue Jun 16, 2020 3:44 pm

Hola,
volviendo al tema, detectamos que el problema esta en la actualización del browse luego del :REQUERY(), adjunto el video del ejemplo.

https://drive.google.com/file/d/1rRPeG_5MQ3dKp6sYen1YbHqzO6xtiB7U/view?usp=sharing

Saludos.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby nageswaragunupudi » Tue Jun 16, 2020 7:55 pm

Can you please help by testing this small program independently of your main application.

Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   local oCn, oRs

   oCn := maria_Connect( ... )
   oRs := oCn:RowSet( "SELECT * FROM clientes " + ;
                       "WHERE NumeroDocumento LIKE <1> and Apellidos LIKE <2> " + ;
                       "and Nombres LIKE <3> ORDER BY Apellidos" )
   // for the purpose of the test, substitute <1>, <2>, <3> with constant values
   
   XBROWSER oRs FASTEDIT SHOW RECID

   oRs:Close()
   oCn:Close()

return nil
 


Please test adding a record by clicking on the Add button and see if this behaves correctly or still you have problems.
Regards

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

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Mon Jun 22, 2020 11:13 am

Hola,

este codigo si funciona, pero falla al hacer o aplicar requery.

Saludos.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby nageswaragunupudi » Mon Jun 22, 2020 6:18 pm

Requery works perfectly,

Please try in the above sample
Code: Select all  Expand view

XBROWSER oRs FASTEDIT SHOW RECID SETUP ( oBrw:bRClicked := { |r,c,f,o| oRs:Requery(), o:Refresh() } )
 


Keep right clicking on the xbrowse as many times as you like. Please let us know if requery fails.
Regards

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

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Tue Jun 23, 2020 10:41 pm

Mr Rao,
El ejemplo que esta poniendo no es aplicable al problema que le planteo en el principio del post, el xbrowse que usamos esta definido en un DIALOG como verá en el ejemplo que le suministré.
En el xbrowser funciona pero cuando mira mi ejemplo enviado no funciona correctamente el :REQUERY().
Saludos.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby nageswaragunupudi » Fri Jun 26, 2020 6:41 pm

Thanks for sharing your prg, rc files along with your data.

You chose to use the method EditBaseRecord() for editing the record (though it is not necessary or recommended in this case, but that is a separate discussion).

The method gets the record data ready and calls the edit dialog. We may choose to save or dischard the changes in the edit dialog. After exiting the dialog, this method synchronizes the saved data with the rowset in memory and refreshes the browse. Till this sychronization process is completed, we ourselves should not disturb the rowset by calling Requery or by other means. Normally, no requery is required to update the data and browse and all this work is done automatically by the method.

In case we want to requery with different criteria, we can do it after execution of the method EditBaseRecord() is complete but not half-way during its execution.

Eg:
ACTION ( oRs:EditBaseRecord(....), oRs:Requery( new params ), oBrw:Refresh() )

Accordingly, we modified the program as below and this works as expected:
Code: Select all  Expand view
/*
   DEMO : mariarq.prg (ReQuery)
   Por  : Ariel Cagiao
   Fecha: 17/06/20
*/

#include "fivewin.ch"

#define TRUE .t.
#define FALSE .f.

static oWMain
static oConn
static oQryCli
static cDocumento
static cApellidos
static cNombres

#define CLR_BACKAMAR nRGB( 255, 255, 230 )

// -------------------------------------------------------------------------- \\
PROCEDURE Main()
local oErr

   // Vars
   cDocumento:= cApellidos:= cNombres:= ""

   // Coneccion

//   FWCONNECT oConn HOST "localhost" USER "root" PASSWORD "qw" DATABASE "mgface"
   FWCONNECT oConn HOST "localhost" USER "root" PASSWORD "India@1947" DATABASE "fwh"
   if oConn == nil
      MsgStop( "FWMaria Error:" +oConn:cError, cValToChar(oConn:nError) )
   endif

   fBrwClientes()
 ? "Zas!"
   oConn:Close()

// Fin

#define _BtAgr   1
#define _BtEdi   2
#define _oBrw    3
// -------------------------------------------------------------------------- \\
FUNCTION fBrwClientes()
local oDlg, ;
      aO[_oBrw]

   // Select Tabla
   oQryCli:= oConn:RowSet( "SELECT * FROM clientes " + ;
                           "WHERE NumeroDocumento LIKE ? and Apellidos LIKE ? and Nombres LIKE ? " + ;
                           "ORDER BY NumeroDocumento", ;
                           { cDocumento, cApellidos, cNombres } )

   //XBROWSER oQryCli FASTEDIT SHOW RECID
   DEFINE DIALOG oDlg RESOURCE "brw_BDatos" TITLE "Tabla de Clientes"

   REDEFINE XBROWSE aO[_oBrw] ID 300 OF oDlg AUTOSORT ;
           COLUMNS "NumeroDocumento", "Apellidos", "Nombres" ;
           HEADERS "NumeroDocumento", "Apellidos", "Nombres" ;
           OBJECT  oQryCli UPDATE

   WITH OBJECT aO[_oBrw]
      :nStretchCol        := STRETCHCOL_LAST

      // Get de Cabecera
      :lGetBar   := .T.
      :bClrEdits := { || { CLR_BLACK, CLR_BACKAMAR } }
   END

   WITH OBJECT aO[_oBrw]:NumeroDocumento
      :cHeader:= "Dcto N°"
      :nWidth := 110

      :Cargo:= "NumeroDocumento"
      :bBarGetAction:= {|| SetFilterRegistro( aO[_oBrw] ) }
   END
   WITH OBJECT aO[_oBrw]:Apellidos
      :nWidth := 300

      :Cargo:= "Apellidos"
      :bBarGetAction:= {|| SetFilterRegistro( aO[_oBrw] ) }
      :cBarGetPic:= "@!"
   END
   WITH OBJECT aO[_oBrw]:Nombres
      :cHeader:= "Nombres"
      :nWidth := 1

      :Cargo:= "Nombres"
      :bBarGetAction:= {|| SetFilterRegistro( aO[_oBrw] ) }
      :cBarGetPic:= "@!"
   END

   aEval( aO[_oBrw]:aCols, { |o,n| IF(o:cargo <> Nil, ( o:uBarGetVal  := Space( 50 ), ;
                                                        o:cBarGetBmp  := HB_UTF8CHR(0xE16E), ;
                                                        o:bBarGetValid:= {|| SetFilterRegistro( aO[_oBrw] ) } ), ) } )

    REDEFINE BUTTONBMP aO[_BtAgr] ID 501 OF oDlg ;
             RESOURCE  0xE1E2 TEXTRIGHT ;
             TOOLTIP   "Agrega" ;
             ACTION    ( oQryCli:EditBaseRecord( nil, TRUE, {|oRec| AgrEdiCliente( oRec, aO[_oBrw] ) }, aO[_oBrw] ), ;
                         SetFilterRegistro( aO[_oBrw] ) )
   aO[_BtAgr]:bColorMap:= {|| { , CLR_HGREEN } }

    REDEFINE BUTTONBMP aO[_BtEdi] ID 502 OF oDlg ;
             RESOURCE  0xE104 TEXTRIGHT ;
             TOOLTIP   "Edita" ;
             ACTION    ( oQryCli:EditBaseRecord( nil, FALSE, {|oRec| AgrEdiCliente( oRec, aO[_oBrw] ) }, aO[_oBrw] ), ;
                         SetFilterRegistro( aO[_oBrw] ) )
   aO[_BtEdi]:bColorMap:= {|| { , CLR_GREEN } }

   ACTIVATE DIALOG oDlg CENTER

   oQryCli:End()

   return( nil )
// Fin


#define _BtSve       1
#define _BtFin       2
#define _GApellido   3
#define _GNombre     4
#define _GDNI        5
// ----------------------------------------------------------------------------- \\
//
FUNCTION AgrEdiCliente( oCliente, oBrw )
local oDlg, ;
      oErr, ;
      bSave, ;
      aO[ _GDNI ], ;
      lOk:= FALSE

   // Dialogo
  DEFINE DIALOG  oDlg RESOURCE "get_DatosClientes"

   // Datos Cliente
   REDEFINE GET aO[_GApellido] VAR oCliente:Apellidos ID 101 OF oDlg UPDATE ;
            PICTURE "@!;S40" COLOR CLR_BLUE, CLR_BACKAMAR ;
            CUEBANNER "* Obligatorio *"
   REDEFINE GET aO[_GNombre] VAR oCliente:Nombres ID 102 OF oDlg UPDATE ;
            PICTURE "@!;S40" COLOR CLR_BLUE, CLR_BACKAMAR ;
            CUEBANNER "* Obligatorio *"
   REDEFINE GET aO[_GDNI] VAR oCliente:NumeroDocumento ID 103 OF oDlg UPDATE ;
            COLOR CLR_BLUE, CLR_BACKAMAR ;
            CUEBANNER "* Obligatorio *"

    REDEFINE BUTTONBMP aO[_BtSve] ID 501 OF oDlg ;
             RESOURCE  0xE105 TEXTRIGHT ;
             TOOLTIP   "Guarda" ;
             ACTION    ;
             ( oBrw:oCol( 1 ):oBarGet:cText := Space( 50 ), ;
               oBrw:Apellidos:oBarGet:cText := oCliente:Apellidos, ;
               oBrw:oCol( 3 ):oBarGet:cText := Space( 50 ), ;
               oCliente:Save(), oDlg:End() )
   aO[_BtSve]:bColorMap:= {|| { , CLR_HBLUE } }

    REDEFINE BUTTONBMP aO[_BtFin] ID 502 OF oDlg ;
             RESOURCE  0xE106 TEXTRIGHT ;
             TOOLTIP   "Edita" ;
             ACTION    oDlg:End()
   aO[_BtFin]:bColorMap:= {|| { , CLR_RED } }

   ACTIVATE DIALOG oDlg CENTER

   return( TRUE )
// Fin

// ----------------------------------------------------------------------------- \\
//     Consultas Filtradas
function SetFilterRegistro( oBrw )
 local oCol, ;
       uVal, ;
       uValFil:={}

   FOR EACH oCol IN oBrw:aCols
       uVal := oCol:uBarGetVal

       if ValType(uVal)=="C"
          aAdd( uValFil, AllTrim( uVal ) )
       elseIf ValType(uVal)=="N"
          aAdd( uValFil, Str( uVal ) )
       end
   NEXT

   if Len(uValFil) > 0
      cDocumento:= uValFil[1]+'%'
      cApellidos:= uValFil[2]+'%'
      cNombres  := uValFil[3]+'%'

      if !Empty( oQryCli )
         oQryCli:Requery( { cDocumento, cApellidos, cNombres } )
         oBrw:Refresh()
         oBrw:SetFocus()
      end
   end

   return( TRUE )
// Fin
Regards

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

Re: Mr. Rao, Registros duplicados en xBrowse con un ReQuery

Postby Ariel » Sat Jun 27, 2020 12:30 pm

Mr. Rao,

Perfecto! ahora si funciona correctamente, en base a lo que comenta :
" You chose to use the method EditBaseRecord() for editing the record (though it is not necessary or recommended in this case, but that is a separate discussion)."

en que caso es recomendable usar EditBaseRecord() y en cual no ? porque los ejemplos que vi en samples lo utilizan, de ahi que me base en los ejemplos para construir esta consulta.

Gracias.
Ariel
 
Posts: 374
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 11 guests