Hi,
I have the following code, but this gives me (in the GetMulti...) a nullreference-exception.
I think that the problem is in the RelactionCollection, but I'm not sure.
(Using v2004.2 with SelfServicing)
Dim _purchaseInvoiceFields As New ResultsetFields(6)
_purchaseInvoiceFields.DefineField(PurchaseInvoiceFieldIndex.Id, 0, "Id")
_purchaseInvoiceFields.DefineField(CostTypeFieldIndex.Title, 1, "CostType")
_purchaseInvoiceFields.DefineField(CompanyFieldIndex.Name1, 2, "Company")
_purchaseInvoiceFields.DefineField(PurchaseInvoiceFieldIndex.BookingNo, 3, "BookingNo")
_purchaseInvoiceFields.DefineField(PurchaseInvoiceRowFieldIndex.AmountEur, 4, "AmountPurchase")
Dim _purchaseInvoiceRelations As New RelationCollection ' Relations
_purchaseInvoiceRelations.Add(PurchaseInvoiceEntity.Relations.CompanyEntityUsingSupplierId, JoinHint.Left)
_purchaseInvoiceRelations.Add(PurchaseInvoiceEntity.Relations.PurchaseInvoiceRowEntityUsingPurchaseInvoiceId, JoinHint.Left)
_purchaseInvoiceRelations.Add(PurchaseInvoiceRowEntity.Relations.CostEntityUsingCostId, JoinHint.Left)
_purchaseInvoiceRelations.Add(CostEntity.Relations.CostTypeEntityUsingCostTypeId, JoinHint.Left)
Dim _purchaseInvoiceSorter As New SortExpression ' Sorting
_purchaseInvoiceSorter.Add(SortClauseFactory.Create(PurchaseInvoiceFieldIndex.BookingNo, SortOperator.Ascending))
Dim _purchaseInvoiceFilter As New PredicateExpression ' Filter
_purchaseInvoiceFilter.Add(PredicateFactory.CompareRange(PurchaseInvoiceRowFieldIndex.TransportOrderId, _orderIdRange))
Dim _purchaseInvoiceTable As New DataTable ' Fill list
_dao.GetMultiAsDataTable(_purchaseInvoiceFields, _purchaseInvoiceTable, 0, _purchaseInvoiceSorter, _purchaseInvoiceFilter, _purchaseInvoiceRelations, False, Nothing, Nothing, 0, 0)