Dennis,
Sorry it took me so long to get back to you! We've been digging out from under a hard drive crash the last few days.
>I don't really understand how the business object relationships in the projectsform are working. For instance, the relationship between cclientid in projects and cid in clients.
>1. Does the fact that the view v_projects has both tables in it have anything to do with this?>
>2. Does the aviewparameters arry in the postinithook of contactsobj pass the cclientid to the view and requery using the cid field because of the property cuniqueidfield - cID?>
You're right...the v_Projects.cClientID field is a pointer to the v_Clients.cID field. The relationship between the views is set up by means of view parameters.
The following code is stored in ContactsObj.PostInitHook():
DIMENSION This.aViewParameters[1, 2]
This.aViewParameters[1,VPARM_NAME] = 'vp_cClientID'
This.aViewParameters[1,VPARM_EXPR] = 'v_Projects.cClientID'
The business object Requery() method looks in the aViewParameters array to see if there are any view parameters specified before it issues a Requery(). The above code tells the Requery method to set the vp_cClientID parameter's to whatever value is stored in v_Projects.cClientID.
If you check out the v_ClientContacts view, you will see a filter has been set using the vp_cClientID view parameter.
So...the value stored in v_Projects.cClientID for the record currently selected on page 1 will be saved to vp_cClientID before the Requery() is issued.
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com