>Just looking for the proper way to do this.
>
>Simple example: Say you have a bizobj called 'oStates' with the states.dbf in the DE as the ISA.
>
>1) If you had a method called getStateList() that was supposed to return the contents of the states.dbf file in the manner specified by the dataformat property, what would be the proper code for doing this, i.e., taking advantage of OOP and the power of the framework?
>
>2) Is creating an object/method such as this even proper OOP to begin with?
>
>Thanks for all your help--what a great support network!
>
>Paul
Paul,
For question 1:
Under most circumstances a business Object for a lookup/rowsource view can be dropped on the form and have the NoDataOnLoad property set to .F. (assuming you've set up the bizobj with the DE when you created the BO.)
When the form is instantiated, so is the BizObj and the view is opened loaded with data.
Accessing the table is simply a matter of creating an object variable, loSelect is a popular one, to select the States view:
LOCAL loSelect
loSelect = CREATEOBJECT("cSelect", "ThePathTo.StatesBizObj.GetAlias()")
Check out the Devguide on the utility cSelect class.
For question 2:
From your example it looks like GetStateList() could be an attempt to duplicate what the StatesBizObj does or what cSelect does. If It's duplicating the framework's bizobj, the bizobj should have already loaded the data (via the view.) If it's just to select the States VIEW, why not just use cSelect.
Gil Munk
"If a nation expects to be ignorant and free, it expects what never was and never will be." - Thomas Jefferson