Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty DataSet During CheckRules
Message
 
To
27/03/2012 09:34:39
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01539439
Message ID:
01539589
Views:
60
This message has been marked as the solution to the initial question of the thread.
Frank,

>I have a business object process that runs through all the active Insurance policies does some checks and changes some values if necessary. When I try to save any policy that has been changed I am getting rule validations breaking where they should not be. In my debugging I can see that the rules of my oPolicy object are failing. oPolicy is a child of oPolicyHeader. When the CheckRules is called the dataset for oPolicy has two records in it and only a couple fields populated. However, just prior to that, the oPolicy entity shows the correct values. What I can't work out is why this dataset has two records (in some cases there may be more than one, but in this case there should only be one) and why only some of the fields are populated.
>
>Here is my code:
>
>
            this.oPolicyHeader.GetEmptyDataSet();
>            this.oPolicyHeader.NewEntity(); 
>            this.oPolicyHeader.GetPolicyHeaderByPolicyHeaderPK(oPolicyHeaderEntity.PolicyHeaderPK);
>
>            this.oPolicy = new Policy();
>            this.oPolicy.GetEmptyDataSet();
>            this.oPolicy.NewEntity(); 
>            this.oPolicy.GetPolicyByPolicyHeaderFK(oPolicyHeaderEntity.PolicyHeaderPK);
>
>some processing code goes here
>
>                mmSaveDataResult result = this.oPolicyHeader.SaveEntity();
>
>How do I debug this? Or can anyone spot what I am doing wrong?

In the last two lines of code you first create a new entity, which adds a new entity to the Policy business object's data set. Right after that, you get a policy by header FK. Do you really want to create a new entity before retrieving the policy by fk?

Best 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform