Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mahmood 28 posts 48 karma points
    Jun 16, 2011 @ 07:54
    Mahmood
    0

    How to get recordId in xslt?

    Hi,

    I want to get recordId of contour form on submission,,, ryt now i am trying

    <xsl:variable name="recordId" select="umbraco.library:RequestQueryString('id')"/>

    <xsl:value-of select="umbraco.contour:GetRecord($recordId)"/>

    it is giving error msg. 

    if i try to get record id by giving hardcoded values then its working fine... 

    <xsl:value-of select="umbraco.contour:GetRecord('7e4e0a56-7f26-4fc6-9cf5-9864db030cc1')"/>  

    can anyone tell wut is wrong???

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jun 16, 2011 @ 08:35
    Dennis Aaen
    0

    Hi Mahmood,

    I know nothing about contour, but I will now try to help anyway.
    I assume that ID is an attribute. If so, I think you are missing an @ in front of ID.

    So try something like this.

    <xsl:variable name="recordId" select="umbraco.library:RequestQueryString('@id')"/>
    <xsl:value-of select="umbraco.contour:GetRecord($recordId)"/>


    But as I said, I don´t know anything about the contour, but hope it helps you further.

    /Dennis

     

  • Mahmood 28 posts 48 karma points
    Jun 16, 2011 @ 09:10
    Mahmood
    0

    hi Dennis,

    i am getting syntax error at this line, i searched n found that ppl using this line to get the contour recordId but in my case it is not working

     

    <xsl:value-ofselect="umbraco.contour:GetRecord($recordId)"/>

  • Mahmood 28 posts 48 karma points
    Jun 16, 2011 @ 14:49
    Mahmood
    0

    Hello can anyone tell me how to get recordId on form submission????

    m getting synatax error on this line

    <xsl:value-ofselect="umbraco.contour:GetRecord($recordId)"/>
    GetRecord only accepting string 
  • León van de Pavert 15 posts 37 karma points
    Feb 09, 2012 @ 11:37
    León van de Pavert
    0

    When saving the xslt macro, some sort of check is done and when the value of $recordid is not set it'll throw an error. If you wrap it in

    <xsl:if test="$recordid!=''">    
    <xsl:value-of select="umbraco.contour:GetRecord($recordId)"/>
    </xsl:if>

    the error shouldn't appear.

    See http://our.umbraco.org/forum/umbraco-pro/contourour.umbraco.org/forum/umbraco-pro/contourour.umbraco.org/forum/umbraco-pro/contour/21333-how-to-get-recordId-on-form-submission.

    Also, the GUID has to be a string in the correct format; more about GUIDs on http://www.guidgenerator.com/online-guid-generator.aspx

     

    Cheers,
    León

  • Tybs 1 post 21 karma points
    Apr 11, 2014 @ 16:24
    Tybs
    0

    I just spend six hours on finding this one particular piece of code... thought I'd share it here, since others might waste precious time on it as well.

    When using a xslt transformed email, you can include the recordId by using the following code:

    <xsl:variable name="recordId" select="$records/id" />
    <xsl:value-of select="$recordId"/>

Please Sign in or register to post replies

Write your reply to:

Draft