How can I get ParentCategoryID in order to create back link.
Thanks in advance
How can I get ParentCategoryID in order to create back link.
Thanks in advance
What is your scenario?
ML9.3.1.1
SQL 2012 Express
VS 2010
Azure VM
I would like to create back button on page if parent category id = xx otherwise it won't be visible. So i need to check if parent category id is one number (e.g. 79) if it is show back button.
You can just adjust the query in the XMLPackage and then use an XLS If statement to do exactly what you are talking about.
ML9.3.1.1
SQL 2012 Express
VS 2010
Azure VM
Its executing procedure, really complex procedure, so what I need is just to get parent category id, then I will use if statement. So how can I get value of ParentCategoryID from this
Code:<query name="ParentCategoryID" rowElementName="ParentCategoryID"> <sql> <![CDATA[select ParentCategoryID from Category where CategoryID=@CatID]]> </sql> <queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0" validationpattern="" /> </query> <PackageTransform>
I would put the package in debug mode and then find the XPath to the element you want and then define a xsl:variable so you can use it in the If...Then statement later on.
ML9.3.1.1
SQL 2012 Express
VS 2010
Azure VM
I thought so, there is no easy way like
Code:<xsl:when test="$EntityID=19">
Sure you can do that, you just need to have a xsl:variable for EntityID and you're good to go.
If you need help, send me your XMLPackage.
ML9.3.1.1
SQL 2012 Express
VS 2010
Azure VM
I have param entity id, and its id of current category, what I need is to get ParentCategoryID of that id.
eg in db there is category with id 73, and its parent is 83.
So what I need is to get that ParentCategoryID from db, or from anywhere ?
So what I have to manage is to select ParentCategoryID from db using query
How can I put returned query value into paramCode:<query name="ParentCategory" rowElementName="ParentCategoryID"> <sql> <![CDATA[select ParentCategoryID from Category where CategoryID=@CatID]]> </sql> <queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0" validationpattern="" /> </query>
Code:<xsl:param name="ParentCategoryID"> xxxx//I don't knwo what to put here </xsl:param>
It seems you don't understand how an XSL works. The parameter is something that has to be passed in, so you can use xsl:call-template and xsl:with-param to populate the xslaram variables.
If you aren't using a template with parameters then you need to use xsl:variable.
Have a look at notification.receipt.xml.config and you'll see pretty clearly what is going on, and how to work with extra SQL statements like you're trying to do. Otherwise, I'll need to see the entire XSL document to be able to help you.
ML9.3.1.1
SQL 2012 Express
VS 2010
Azure VM