This functionality does not seem to work, or at least, following the instructions in DEVGUIDE.DOC the farthest I can get is to see the label caption changed during the form session, as soon as I close the form, when opened again the original caption is back.
The only message that I could find was #434689, but no solutions were provided nor the originator followed up.
I figured out what was going on, though :
Let's suppose, that as explained in the user's manual, you set the This.cLabelControlSource property to "v_myview.myfieldcaption".
Then, the reason why the label caption dissapears when reopening the form, is that when the CControlContainer.INIT event runs (KCustCtl.vcx), the following line,
lcCaption = &lcControlSource
evaluates to empty.
Why is this? Well, while debugging this line, EOF('v_myview') evaluates to .T. and so seem to be the other tables/views in the forms dataenvironment.
Of course that if I run the CControlContainer.INIT event in the Activate event of the page that contains the control, I can make it work. This is because at that point the view record pointer is at the top of the cursor or at the record being edited,(I am using a form based on cbizobjmaintenanceform), but this is not a valid solution.
Any ideas are more than welcome. Thanks!
The following is part of the in for CControlContainer.INIT for better understanding.
IF NOT EMPTY(This.cLabelControlSource)
lcControlSource = This.cLabelControlSource
lcCaption = &lcControlSource
IF NOT EMPTY(lcCaption)
This.Label.Caption = ALLTR(lcCaption)
ENDIF
ENDIF