Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Business rule against a form property
Message
De
06/12/2001 13:26:54
 
 
À
06/12/2001 12:57:57
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00590665
Message ID:
00590700
Vues:
28
Sally --

I'm not working at this moment in MM, but here are a couple thoughts.

A good way to handle a situation like this is through a parameter passed to the business rule object. Does the framework automagically pass a reference to the form object on which the class is hosted? If so, it's probably stored as a property of the business rule object, something like oCallingForm.

If so, then this is simple:
if v_invoice.ext + v_invoice.tax + v_invoice.extras <> <b>oCallingform.nTotal</b>
If the form object is not passed by the foundation, can you pass it as a parameter in your call, and then store it to a property in the init for later use by your object's methods?

Using a workaround like you've tried may work. But, in many situations where an object needs to communicate with another object, we don't have that reference on the side. Managing object references is one of the Joys of OO!

Jay


>Hope this isn't another dumb question but ....
>
>I have a business rule object that has a rule which simply compares the sum of several fields in the view with a total that the user entered in the form (the tot is saved in a property on the form).
>
>I tried something like:
>
>if v_invoice.ext + v_invoice.tax + v_invoice.extras <> thisform.nTotal
>
>which blew up because there is no form in the business rule class! So I'm using _screen.activeform.nTotal instead. Is this the best way to reference the property?
>
>Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform