Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty DataSet During CheckRules
Message
De
28/03/2012 16:09:47
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01539439
Message ID:
01539599
Vues:
49
>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,

Thanks Kevin, that was it. I vaguely remember getting in the habit of calling NewEntity and then my code to what i thought would fill the entity withthe desired data, but I guess that my thinking was wrong.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform