Information générale
Catégorie:
The Mere Mortals Framework
Gil,
>>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
>
>Sally,
>
>Agreeing with Michael and Jay, it's good practice not to reference a form from within a business object unless you wrap it in a method that determines if the BO is being hosted by a form. The kBizObz has just such a method: IsFormHost().
Unfortunately Sally is talking about a BizRule object which is linked to a BizObj, so running IsFormHost on the BizRule object will return .F. How about a property on the BizObj with an Access Method which returns a form reference or .NULL. if the BizObj is not dropped on a form?
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement