Hi Roger,
I can't seem to find a solution. Please help.
How to retrieve the name of the DBF field being edited
from function: AFTER_EDITING(oBrowse)
DCBROWSE oBrowse ALIAS "TEST";
EDIT xbeBRW_ItemSelected ;
ACTION {|| AFTER_EDITING(oBrowse) }
DCBROWSECOL FIELD TEST->ID_NAME CARGO "ID_NAME" PARENT oBrowse
AFTER_EDITING(oBrowse)
oColon := oBrowse:getcolumn(ncol)
_cargo_ := var2char( oColon:CARGO[3] )
msgbox(_cargo_) //--> "ID_NAME"
return nil
Is there ANOTHER more elegant way without using CARGO
I'm confused by THIS, that in the same function it is possible to add a NEW column
to oBrowse by writing the name of the dbf field TEST->FLAG into the oXbpColumn object:
oXbpColumn := XbpColumn():new()
oXbpColumn:dataLink := {|| TEST->FLAG }
oXbpColumn:create()
oBrowse:addColumn( oXbpColumn )
I am convinced that there must be a way to get the DBF field name "FLAG"
without using CARGO. But I can't find it.
DCBROWSE AND MY PROBLEM
- slobodan1949
- Posts: 86
- Joined: Mon Apr 25, 2011 8:57 am
- Location: SERBIA
- Contact:
Re: DCBROWSE AND MY PROBLEM
AFTER_EDITING(oBrowse)
oCol = oBrowse:getcolumn(oBrowse:colPos)
cDataLink = VAR2CHAR(oCol:dataLink)
cFldName = STRTRAN(SUBSTR(cDataLink,AT(">",cDataLink) + 1),"}")
msgbox(cFldName)
return nil
oCol = oBrowse:getcolumn(oBrowse:colPos)
cDataLink = VAR2CHAR(oCol:dataLink)
cFldName = STRTRAN(SUBSTR(cDataLink,AT(">",cDataLink) + 1),"}")
msgbox(cFldName)
return nil
Best regards,
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
- slobodan1949
- Posts: 86
- Joined: Mon Apr 25, 2011 8:57 am
- Location: SERBIA
- Contact:
Re: DCBROWSE AND MY PROBLEM
Hvala Slavko.
Ovo mi je stvarno mnogo trebalo a nisam uspeo da provalim gde leži zec. Zadužio si me.
Ovo mi je stvarno mnogo trebalo a nisam uspeo da provalim gde leži zec. Zadužio si me.
Re: DCBROWSE AND MY PROBLEM
Here is another way you can store the field name in the XbpColumn object:
You can assign any new variable to the column object. It is stored as a NOIVAR.
I recommend preceding the variable name with an underscore so as not to overwrite any exported variables already defined in the DC_XbpColumn class.
Code: Select all
DCBROWSECOL FIELD CUSTOMER->bill_name HEADER 'Billing Name' WIDTH 25 PARENT oBrowse ;
EVAL {|o|o:_fieldname := 'BILL_NAME'}
DCREAD GUI EVAL {||(wtf oBrowse:getColumn(1):_fieldName}
I recommend preceding the variable name with an underscore so as not to overwrite any exported variables already defined in the DC_XbpColumn class.
The eXpress train is coming - and it has more cars.
- slobodan1949
- Posts: 86
- Joined: Mon Apr 25, 2011 8:57 am
- Location: SERBIA
- Contact:
Re: DCBROWSE AND MY PROBLEM
Thanks Roger,
this method works well.
this method works well.