main logo
Subject: Re: View Parameters for a StandAlone BO
Author: Bhavbhuti Nathwani
Posted: 2002/07/24 00:39:34
 
View Entire Thread
New Search


Thanks Pamela. I'll give it a shot. Knowledge is more experience than just learning. I had tried studying the code as was advised when I started with CB but couldn't make head or tail of it.

<i><font color="#663300">Hi Bhavbhuti,

<i><font color="#663300">The view has is parameterized as cDOSName = ?vp_cFilter. I use this BO in a Form Class with a property cFilter in the form and would want this property to filter the view.

I tried putting THISFORM.cFilter in the builder with no luck. Also I tried changing ?vp_cFilter to THISFORM.cFilter same results, none.</font></i>

That is because Thisform.cFilter is not in scope during a REQUERY(). Here is the relevant code from cBizObj.Requery()
<pre>IF !EMPTY(This.cViewParmName) AND This.lGetViewParmFromParent
lcViewParm = This.cViewParmName
PRIVATE &lcViewParm
&lcViewParm = This.GetViewParmValue()
ENDIF</pre>

By default, GetViewParmValue() returns the value of the parent bizObj's key field. I don't recommend this as an example of good OOP design, in fact, I recommend against it, but you can overwrite GetViewParmValue()
to RETURN Thisform.cFilter.
</font></i>

Regards
Bhavbhuti
 
©2002 Bhavbhuti Nathwani
<-- Prior Message New Search Next Message -->