daelmo wrote:
Do you have some fields mapped onto related entities is LLBLGenPro Designer?
Please post the code's lines that triggers that error. Also please post the exaca exepction and stack race.
Here is the "Files on relations" tab in the LLBLGen designer:
FieldName Relation Hidden
Assessment TaxPayment-Assessment(m:1) False
TaxPaymentTransactionMap TaxPayment- TaxPaymentTransactionMap(1:1) False
TaxPaymentVoidMap TaxPayment-TaxPaymentVoidMap(1:1) False
TaxPaymentVoidMap_ TaxPayment-TaxPaymentVoidMap(1:1) False
I should explain that TaxPaymentVoid map is a table that maps one tax payment to another tax payment. It shows that one tax payment voids another tax payment.
Here is the call that triggers the error:
GlobalDBConnection.GetAdapter().FetchEntityCollection(taxPayments, bucket, -1, sortingSpec.GetLLBLGenSortExpression());
I should explain that GlobalDBConnection.GetAdapter() just returns a DataAccessAdapter object. sortingSpec.GetLLBLGenSortExpression() creates an ISortExpression. In this situation I'm NOT sorting by the Reference field. In fact none of the code I wrote uses these new fields.
Here is the exception:
The field name 'Reference' isn't known in the element 'TaxPaymentEntity'\r\nParameter name: fieldName
Here is the stack trace
at SD.LLBLGen.Pro.ORMSupportClasses.PersistenceInfoProviderBase.GetFieldPersistenceInfo(String elementName, String fieldName)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetFieldPersistenceInfo(IEntityField2 field)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.GetFieldPersistenceInfos(IEntityFields2 fields)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollectionInternal(IEntityCollection2 collectionToFill, IRelationPredicateBucket& filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses)
at GCS.SharedBL.TaxPaymentManager.GetTaxPaymentsForAssessment(Int32 assessmentId, EntityCollection`1& taxPayments, SortingSpecification sortingSpec, Boolean postedOnly, Boolean excludeVoids) in D:\PROJECTS\GCSLRMS_DotNet\SharedBusinessLogic\GCS.SharedBL\GCS.SharedBL\TaxPaymentManager.cs:line 742
at GCS.SharedBL.TaxPaymentManager.FillTaxPaymentsForAssessment(AssessmentEntity assessment, SortingSpecification sortingSpec, Boolean postedOnly, Boolean excludeVoids) in D:\PROJECTS\GCSLRMS_DotNet\SharedBusinessLogic\GCS.SharedBL\GCS.SharedBL\TaxPaymentManager.cs:line 822
at GCS.SE.BL.Taxation.SumUpTaxPayments() in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\Taxation.cs:line 1249
at GCS.SE.BL.Taxation..ctor(AssessmentEntity assessment, DateTime maxPaymentDate, Boolean excludeCountyPayments) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\Taxation.cs:line 107
at GCS.SE.BL.SummarizeTaxPaymentsBalances.GetTotals() in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\SummarizeTaxPaymentsBalances.cs:line 267
at GCS.SE.BL.SummarizeTaxPaymentsBalances..ctor(Int32 municipalityID, Int32 year, Nullable`1 realEstate, Boolean munPaymentsOnly, DateTime maxPaymentDate) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.BL\SummarizeTaxPaymentsBalances.cs:line 53
at GCS.SE.App.Controllers.JanuarySettlementController.GetLeviesAndCollections(SettlementJanuaryEntity& jan, DateTime maxPaymentDate) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.App\Controllers\JanuarySettlementController.cs:line 810
at GCS.SE.App.Controllers.JanuarySettlementController.DefaultDataForSettlement(DateTime maxPaymentDate) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.App\Controllers\JanuarySettlementController.cs:line 277
at GCS.SE.App.Forms.FormMaintainSettlement.button_GetData_Click(Object sender, EventArgs e) in D:\PROJECTS\GCSLRMS_DotNet\SE\GCS.SE Solution_UsingSharedBL\GCS.SE.App\Forms\FormMaintainSettlement.cs:line 925
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
As I said before, all this code used to work fine until I added new fields to the TaxPayment table (Reference and TransactionID) and regenerated the LLBLGen code.
Thanks.