Post by buda56 on Jan 23, 2013 19:55:43 GMT -5
Hi,
I am getting the following error whenc trying to run a linq query using Linqer:
Error Compiling Expression: Error Compiling Expression: 'Invoice' is not a member of 'Jaix.InvoiceLines'.
This seems to happen when trying to return a sub property value to include in a query.
Here is the query:
From invoicelines In db.InvoiceLines _
Join consignments In db.Consignments _
On New With { .ConsignmentID = CInt(invoicelines.ConsignmentID), .ConsignmentRecordTypeID = CInt(invoicelines.ConsignmentRecordTypeID) } _
Equals New With { .ConsignmentID = consignments.ConsignmentID, .ConsignmentRecordTypeID = consignments.RecordTypeID } _
Join manifestconsignments In db.ManifestConsignments _
On New With { consignments.ConsignmentID, consignments.RecordTypeID } _
Equals New With { manifestconsignments.ConsignmentID, .RecordTypeID = manifestconsignments.ConsignmentRecordTypeID } _
Join consignmentadditionalcharges In db.ConsignmentAdditionalCharges _
On New With { .ConsignmentID = CInt(invoicelines.ConsignmentID), .ConsignmentRecordTypeID = CInt(invoicelines.ConsignmentRecordTypeID) } _
Equals New With { .ConsignmentID = consignmentadditionalcharges.ConsignmentID, .ConsignmentRecordTypeID = consignmentadditionalcharges.ConsignmentRecordTypeID } _
Join manifests In db.Manifests _
On New With { manifestconsignments.ManifestID, manifestconsignments.ManifestRecordTypeID } _
Equals New With { manifests.ManifestID, .ManifestRecordTypeID = manifests.RecordTypeID } _
Where _
invoicelines.Invoice.BatchNumber = "130124_003-1" _
Group New With {manifests, consignmentadditionalcharges} By _
manifests.CostCentreID, _
consignmentadditionalcharges.AdditionalChargeID _
Into g = Group _
Select _
CostCentreID, _
AdditionalChargeID, _
ChargeTotal = CType(g.Sum(Function(p) p.consignmentadditionalcharges.TotalCharge),Decimal?)
The code errors on the where line when it is trying to compare the supplied batch number to a collection of a collection.
Regards..
Peter