I've had a template created for a while that spits out an excel file containing four columns: Old Table Name, LLBL Entity Name, Old Field Name, and New Property Name... It's easier for some in our group to fire up this Excel file instead of LLBLGen for several reasons, but that's not important really..
Until now, the Excel file has never included fields mapped on related fields. I've got it half working, but ElementTargetObjectName unexpectedly returns the current entity table name and SourceColumnName unexpectedly returns an empty string.
Below are the relevant loops.. I can remove the Excel specific stuff if that makes it easier for you to read. The first inner loop outputs the standard entity fields and works fine For example:
AT197, ApplicantCertificationInformation, CSI32ID, CertificationCodeMasterId
The second loop outputs the related fields.. I want it to output something like
CR132, ApplicantCertificationInformation, mdesc, CertificationDescription (From Certification).
Instead, it outputs
AT197, ApplicantCertificationInformation, <blank>, CertificationDescription (From Certification)
(AT197 should be CR132 and <blank> should be mdesc... Also, <blank> is just a placeholder for an empty space to clarify the problem.)
<[Foreach Entity CrLf]>
<[Foreach EntityField IncludeInherited CrLf]>
<Row>
<Cell><Data ss:Type="String"><[ElementTargetObjectName]></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"><[CurrentEntityName]></Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"><[SourceColumnName]></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"><[EntityFieldName]><[If EntityFieldIsOverriden]><[If Not EntityFieldContainedInCurrentEntity]>_<[EntityFieldEntityName]><[EndIf]><[EndIf]></Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
</Row>
<[NextForeach]>
<[Foreach RelatedEntityField ]>
<Row>
<Cell><Data ss:Type="String"><[ElementTargetObjectName]></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"><[CurrentEntityName]></Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"><[SourceColumnName]></Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
<Cell><Data ss:Type="String"><[MappedFieldNameRelatedField]> (From <[ MappedFieldNameRelation ]>)</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
</Row>
<[ NextForeach ]>
<[NextForeach]>
So, how do I get the real source table and field for a RelatedEntityField?