Related Item - Lookup-Field
Hi,
we are trying to configure a pretty basic related-items-list in a form. In other situations we had no trouble setting up relatd-items-lists, but here the situation seems to be different:
The Form is setup for List A, which contains a lookup-field that is populated by a calculated field in List B.
We want to use the related-items list to show additional information from List B.
In the data-source-editor we have chosen the correct list and view, "Filter by form field" and the two fields from List A and B.
When we call this form, the related-items list is empty, a message "In this view of "List B" no items can be displayed" (In dieser Ansicht der Liste "List B" sind keine Elemente anzeigbar) is shown.
Just for tests we have created another text field in List A and have filled this with values. When we chose this field for List A in the data-source-editor, everything works fine. Eperiments with using ID as mentioned in "How to filter related items by almost any field" have not been successful.
So the trouble must have something to do with the use of the lookup-field in List A.
Any idea?
Greetings, Wolfgang
we are trying to configure a pretty basic related-items-list in a form. In other situations we had no trouble setting up relatd-items-lists, but here the situation seems to be different:
The Form is setup for List A, which contains a lookup-field that is populated by a calculated field in List B.
We want to use the related-items list to show additional information from List B.
In the data-source-editor we have chosen the correct list and view, "Filter by form field" and the two fields from List A and B.
When we call this form, the related-items list is empty, a message "In this view of "List B" no items can be displayed" (In dieser Ansicht der Liste "List B" sind keine Elemente anzeigbar) is shown.
Just for tests we have created another text field in List A and have filled this with values. When we chose this field for List A in the data-source-editor, everything works fine. Eperiments with using ID as mentioned in "How to filter related items by almost any field" have not been successful.
So the trouble must have something to do with the use of the lookup-field in List A.
Any idea?
Greetings, Wolfgang
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
The problem is that the lookup field is located in the parent list, not in a child as in our samples. So, here you should configure filtering by Lookup-Calculated column in the Data Source editor, then add an HTML-control onto your form, set CDATA property in False and insert the following code into its Content:
<xsl:variable name="LookupValue" select="substring-before(substring-after(@Lookup,'>'),'<')"/>
<xsl:comment>
<xsl:value-of select="ddwrt:GenFireConnection(concat('*', '@Lookup=', ddwrt:ConnEncode(string($LookupValue))), '')" />
</xsl:comment>
Replace @Lookup with the internal name of your lookup field (@InternalName).
<xsl:variable name="LookupValue" select="substring-before(substring-after(@Lookup,'>'),'<')"/>
<xsl:comment>
<xsl:value-of select="ddwrt:GenFireConnection(concat('*', '@Lookup=', ddwrt:ConnEncode(string($LookupValue))), '')" />
</xsl:comment>
Replace @Lookup with the internal name of your lookup field (@InternalName).
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
I can recommend you to filter the related list by ID instead of the Title. In the Data source editor, set List field to 'ID' and replace the code in HTML-control with the following:
Replace @Lookup with the @internal name of the lookup field from the List A.
I can recommend you to filter the related list by ID instead of the Title. In the Data source editor, set List field to 'ID' and replace the code in HTML-control with the following:
Code: Select all
<xsl:variable name="LookupValue" select="substring-before(substring-after(@Lookup,'&ID='),'&')"/>
<xsl:comment>
<xsl:value-of select="ddwrt:GenFireConnection(concat('*', '@Lookup=', ddwrt:ConnEncode(string($LookupValue))), '')" />
</xsl:comment>
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests