Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Displaying Portal Data

Featured Replies

Can someone fill me in on how to display data from a portal using XSLT? I tried this...

<xsl:for-each select="fmrs:relatedset[@table='line_items']/fmrs:record"?

<xsl:value-of select="fmrs:field[@name='line_items::item_desc']/fmrs:data"/>

</xsl:for-each>

No error reported and the results were included in the XML resultset tree - but not displayed in the final HTML. Portal exists on the layout with the field item_desc in the portal.

Thanks

  • Author

Hey I got it working using the following...

<xsl:for-each select="/fmrs:fmresultset/fmrs:resultset/fmrs:record"><xsl:variable name="record" select="current()"/>

<xsl:for-each select="$record/fmrs:relatedset[@table = 'line_items']/fmrs:record"><xsl:variable name="portal-record" select="current()"/>

<xsl:value-of select="$portal-record/fmrs:field[@name = 'line_items::item_desc']/fmrs:data[1]"/><br/>

</xsl:for-each>

</xsl:for-each>

Can someone enlighten me as to why we need to use variables in this way?

That's too complicated.

<xsl:for-each select="fmrs:relatedset[@table='line_items']/fmrs:record">

<xsl:variable name="portal-row" select="current()"/>

<xsl:value-of select="$portal-row/fmrs:field[@name='line_items::item_desc']/fmrs:data"/>

</xsl:for-each>

does the job.

From the W3C XSLT 1.0 spec:

The current function returns a node-set that has the current node as its only member. For an outermost expression (an expression not occurring within another expression), the current node is always the same as the context node. Thus,

<xsl:value-of select="current()"/>

means the same as

<xsl:value-of select="."/>

However, within square brackets the current node is usually different from the context node."

So you could even try:

<xsl:for-each select="fmrs:relatedset[@table='line_items']/fmrs:record">

<xsl:value-of select="./fmrs:field[@name='line_items::item_desc']/fmrs:data"/>

</xsl:for-each>

  • Author

Thanks again! Got it working & I understand why (most importantly!).

Next problem - I want to be able to delete a portal row (line item in this case).

From the primary table (list view) I can delete an item using the following...

<a><xsl:attribute name="href">item-delete.xsl?-token.rego-id=<xsl:value-of select="fmrs:field[@name='item_rego_id']/fmrs:data"/>&amp;-recid=<xsl:value-of select="@record-id"/></xsl:attribute>Remove</a>

But from another table (ie via a portal) how do I construct the url to go to the related record in line items? In the above url I used -recid=<xsl:value-of select="@record-id" to identify the record item-delete.xsl was to delete. How do I identify the portal row to delete when I am working with a relatedset?

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.