I have read the documentation and searched this forum and haven’t found a solution to this prefetch.
The tables are:
"Person" has many “PersonActivity”s. "PersonActivity" has many “Deployment”s and one "PersonActivityType".
I want to prefetch all these where the PersonActivity is not older than 6 months.
I have the following code which does not run – How do I prefetch two entities of an entity which is already prefetched?
Dim objActivityFilter As IPredicateExpression = New PredicateExpression objActivityFilter.Add(PredicateFactory.CompareValue(PERSONACTIVITYFieldIndex.PAC_END_DATE, ComparisonOperator.GreaterEqual, dtmToday.AddMonths(-6)))
Dim prefetch As PrefetchPath
prefetch = New PrefetchPath(Convert.ToInt32(EntityType.PERSONEntity))
prefetch.Add(PERSONEntity.PrefetchPathPERSONACTIVITY, Integer.MaxValue, objActivityFilter).SubPath.Add(PERSONACTIVITYEntity.PrefetchPathPERSONACTIVITYTYPE)
prefetch.Add(PERSONEntity.PrefetchPathPERSONACTIVITY, Integer.MaxValue, objActivityFilter).SubPath.Add(PERSONACTIVITYEntity.PrefetchPathDEPLOYMENT)
LLBL complains that I have already added the PERSONEntity.PrefetchPathPERSONACTIVITY prefetch
Thanks
John