Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does this work?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00138352
Message ID:
00138991
Vues:
8
Paul,

>I've got a form based on kbizobjform. It has one business object on it. It also has a pageframe w/two pages. On the first page I've got a combo box and two list boxes. When the user selects something from the combobox a view parameter is set and one of the views of the bizobj is requeried which populates the listbox on the left hand side
>of the screen. The user can click on one of these entries, another view parameter is set and another view is requeried with the results displayed in the listview on the right hand side of the screen. If they double click on one of the entries on the right, a modal form (w/no bizobj, and using the data environment of the calling form) is
>displayed. It uses the same view as the Listbox, but displays more of the information.
>
> My question is, why does the modal screen actually display the correct information? How does it know which record to display?>

Since your modal form's DataSession property is set to "1 - Default Datasession", then it shares the DataSession of the calling form and therefore has access to all of views loaded in the calling form's DataSession. This is also true of the record pointer...if the record pointer is set to a particular record in the calling form, it will be pointing to the same record in the modal form.

>On the second page, I've got a similar set-up. I've got two list boxes. The one on the left displays a list of vendors. When the click on one a view parameter is set and the listbox on the right lists all of the invoices associated with that vendor.
>
> This page works OK, as long as I have selected something (anything) off the first page. If I don't select anything (and therefore all of the lists are empty) and click on the second page tab I get an:
>
>Error #11
>Function arguement value, type, or count in invalid
>Line 152
>lcDefaultValue = DBGETPROP(lcBaseTable + "." lcPrimaryKey,"Field","DefualtValue")
>Method: onnew

There are a variety of reasons that you may be causing you to get this error. Based on the error, I suspect that either lcBaseTable or lcPrimaryKey contains an invalid value. First of all, you may want to go back and check to make sure your view has been set up properly. After that, I recommend placing the following code in your business object's OnNew() method and stepping through the code:

SET STEP ON
DODEFAULT()

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform