General information
Category:
The Mere Mortals Framework
Title:
Data Environment questions
I am converting a large application from MM 3.02 to MM 7.0. Yes this is correct MM 3.02 to MM 7.0! Converting is not quite the correct term, rewriting is more like it. I have created a new project and am slowly recreating all of the forms in the new framework. Here is my problem for today:
I have a maintenance form that has fields from the primary business object a page in a page frame. I also have a cListObjEdit on this same page to view child data for this parent record. The associated cListObjEditForm has several combo boxes on it, which seem to work fine. The problem is when I return from the cListObjEditForm, my cListObjEdit grid is not getting updated values displayed. Some fields are updated, but the ones that come from the combo boxes on the edit form are not. The data is ok - if I move off the parent record then back onto it, the updated values are displayed.
In the presavehook() on the edit form is where the problem lies. Here some key properties of my combo box on the edit form:
this.RowSource = "select RCD.cCDTCode,RCD.cId from RCD order by RCD.cCDTCode into cursor crsCDT"
this.RowSourceType = 3 - SQL Statement
this.BoundColumn = 2
this.ControlSource = v_per_aprv.cCDTId
My grid on the cListObjEdit displays the RCD.cCDTCode but the data is tied to the v_per_aprv.cCDTId foreign key. In the presavehook() on the edit form, I have the following code:
REPLACE v_Per_Aprv.cPerId with v_Personnel.cId in v_Per_Aprv
=SEEK(v_Per_Aprv.cCDTId,"RCD","cId")
REPLACE v_Per_Aprv.cCDTCode with RCD.cCDTCode in v_Per_Aprv
When the above code executes, I get the error "Alias not found" - referring to RCD. RCD.dbf is a free table in a different location than myapp.dbc. The data environment for cListObjEdit is set to per_aprvenvironment which lists v_per_aprv and rcd as cursors.
In the original MM 3.02 project, which includes adataenv.prg, the following code exists pertaining to this form:
DEFINE CLASS Per_AprvEnvironment AS myappEnvironment
nInitialSelectedAlias=2
FUNCTION LoadCursors()
DIMENSION this.aCursors[2]
this.aCursors[1] = 'RCD'
this.aCursors[2] = 'v_Per_Aprv'
ENDFUNC
ENDDEFINE
DEFINE CLASS PER_APRV AS CTableCursor
CursorSource = 'PER_APRV'
ENDDEFINE
DEFINE CLASS Rcd AS CFreeTableCursor
cdatabasename = ("CDMS")
CursorSource = ''
FUNCTION INIT()
THIS.CursorSource = ( GoApp.GetSetting("Data Settings","Common Data") + "Rcd.DBF" )
CFreeTableCursor::INIT()
ENDFUNC
ENDDEFINE
DEFINE CLASS v_Per_Aprv AS CDynamicViewCursor
cCursorSource = 'v_Per_Aprv'
ENDDEFINE
Since MM 7.0 uses adataenv.vcx instead of adataenv.prg, I am at a loss as to how to create this code. How do you set up the cTableCursor, cFreeTableCursor, and cDynamicViewCursor?? What am I missing? Suggestions?
Thanks is advance for any and all help.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only