Hi, I have BO which has a bunch of business rules, a couple which are relatively expensive rules which contact the database to insure that some properties are correctly set when saved/updated.
I noticed that these rules run on DataPortal_Create(), and these rules will always fail when the object is initialized, so i don't see the point of running rules just when creating a object for the first time.
I've read discussions on this forum that suggests not using a constructor because of a number of reason, but if I have to choose between initializing default values in two places vs. making expensive database calls on simple object creation....
Is there a way to not get business rules to run on DP_Create, or at least prevent the expensive rules from running?
Thank you!
Are there some properties you can check at the start of the rule to determine whether it should be called or not? e.g if the target is new don't call that rule until propertyA or PropertyB are set?
There is a couple of useful techniques to understand:
Copyright (c) Marimer LLC