Related Documents Transformations

Brenden Kehren asked on August 29, 2014 03:24

I've got a custom document type and inside the transformation there is a repeater that gets the "related" documents for that document being rendered in the transformation. Problem I'm having is the transformation for that repeater and the related documents does not display the actual data even though it is retrieving the related documents.

For instance, in the related document I have Field1, Field2 and Field3. I use <%# Eval("Field1") %> to display the data it does not display anything. When I use <%# Eval("DocumentName") %> it displays the document name as I'd expect.

Can I not access the related docs "custom" fields?

Correct Answer

Brenden Kehren answered on August 29, 2014 05:22

Thanks Jim.

I found my problem, I was not setting the ClassName property. Once I did that, things started working I'd expect.

Here's my final markup:

<cms:CMSRepeater ID="repRelated" runat="server" DelayedLoading="true" RelationshipName="isrelatedto" RelatedNodeIsOnTheLeftSide="false" Path="/%" ClassNames="custom.Product" TransformationName="custom.Product.testing" />

And the code in the transformation to populate the GUID for the related docs repeater:

<script runat="server">
    protected override void OnInit(EventArgs e) 
    {
        base.OnInit(e);
        Guid nodeGuid = ValidationHelper.GetGuid(Eval("NodeGuid"), Guid.Empty);
        repRelated.RelationshipWithNodeGuid = nodeGuid;
        repRelated.ReloadData(true);
    }
</script>
1 votesVote for this answer Unmark Correct answer

Recent Answers


Jim Spillane answered on August 29, 2014 04:38

To display all of the fields, we have been using a queryrepeater and joining the doctype_Joined view with View_CMS_Relationship_Joined in the query.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.