Xbrowse : use bEditvalid, bEditblock of bEditvalue (SOLVED)

Xbrowse : use bEditvalid, bEditblock of bEditvalue (SOLVED)

Postby Marc Venken » Tue Oct 17, 2017 10:06 pm

Hello,

Witch block is best to use for folowing purpose :

In a online system (Mariadb)

oRs .......

I want to save the changes to a change log whenever a user changes a field.
My coaches can change ex. the adres of a member, but I want to log that change :

So I want to store in 'changes" ex. Coach, date, olddata, newdata

I can do it when I change xbrowse data from a selection of rows like this :

Code: Select all  Expand view
function setploeg(oBrw,cPloeg)

    local uSavePos := oBrw:BookMark

    if msgYesNo(str(LEN(oBRW:aSELECTED),3)+"-> Geselecteerde leden verplaatsen")
        FOR I = 1 TO LEN(oBRW:aSELECTED) // obrw:aSELECTED is an array containing recnos marked
          oBrw:BookMark := oBrw:aSelected[ i ]   // works for dbf, rowset, ado and all
          oCn:Insert( "changes", "doorwie, naam, voornaam,oldploeg,newploeg,datum", { setup_naam, oBrw:naam:value, oBrw:voornaam:value, oBrw:p2017:value, cPloeg, date() } )

          if cPloeg <> "NIET ACTIEF"
            oBrw:p2017:VarPut( cPloeg ) // Works for dbf, rowset, ado and all
          endif

          if cPloeg = "EXLEDEN"
             oBrw:exlid:VarPut( .F. )
          endif
          if cPloeg = "NIET ACTIEF"
             oBrw:exlid:VarPut( .T. )
          endif
     
        next
    endif
    oBrw:BookMark := uSavePos

return NIL
 


But i'm looking for a way to do it from insite the xbrowse
Last edited by Marc Venken on Wed Oct 18, 2017 7:34 pm, edited 1 time in total.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : use bEditvalid, bEditblock of bEditvalue

Postby Marc Venken » Wed Oct 18, 2017 7:34 pm

Found it

oCol:bOnChange := { |oCol, uOldVal| OnColChange( oCol, uOldVal ) }
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1431
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests