Is it possible to create your own custom contructors for the entity objects? I couldn't find any examples of this being done on the forums/etc.
An example of what I have in mind is done with this code in my partial class, except it results in two database calls and I'm not really sure if I even should be calling InitClassFetch myself.
public EplanReportSectionInstanceEntity(long entityId, long reportInstanceId, Enums.ReportSectionIds reportSectionId)
{
EplanReportSectionInstanceCollection reportSectionInstances = new EplanReportSectionInstanceCollection();
IPredicateExpression filter = new PredicateExpression(EplanReportSectionInstanceFields.EntityId == entityId);
filter.AddWithAnd(EplanReportSectionInstanceFields.EplanReportInstanceId == reportInstanceId);
filter.AddWithAnd(EplanReportSectionInstanceFields.EplanReportSectionId == reportSectionId);
reportSectionInstances.GetMulti(filter);
if (reportSectionInstances.Count == 0)
{
return;
}
InitClassFetch(reportSectionInstances[0].EplanReportSectionInstanceId, null, null);
}
-Keith