Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 11 of 11

Thread: GetMLValue(ExtensionData)

  1. #1
    scott_rider is offline Junior Member
    Join Date
    Sep 2011
    Posts
    9

    Default GetMLValue(ExtensionData)

    I am working with two xmlpackages. One of them returns a value from Extension Data and the other one doesn't. I am using GetMLValue(ExtensionData). Is there something that restricts access to this?

  2. #2
    scott_rider is offline Junior Member
    Join Date
    Sep 2011
    Posts
    9

    Default Anybody?

    Does anybody have an idea about this?

  3. #3
    jhoskinson is offline Member
    Join Date
    Feb 2009
    Location
    Los Angeles, CA
    Posts
    36

    Default same question.. does anybody answer forum questions anymore??

    trying to find this same answer...

  4. #4
    jhoskinson is offline Member
    Join Date
    Feb 2009
    Location
    Los Angeles, CA
    Posts
    36

    Default specifically....

    In product.variantsinrightbar.xml.config:

    Code:
     
    <xsl:template match="Product">
          <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/>
          <xsl:param name="pSKU" select="aspdnsf:GetMLValue(SkuSuffix)"/>
    ...
    both <xsl:value-of select="$pName" disable-output-escaping="yes" /> and <xsl:value-of select="$pSKU" disable-output-escaping="yes" /> correctly output the data.

    but in entity.gridwithprices.xml.config:

    Code:
     
    <xsl:template match="Product">
          <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/>
          <xsl:param name="pSKU" select="aspdnsf:GetMLValue(SkuSuffix)"/>
    ...
    <xsl:value-of select="$pName" disable-output-escaping="yes" /> correctly outputs the data BUT

    <xsl:value-of select="$pSKU" disable-output-escaping="yes" /> is empty.

    Why is this? Would love some help with this.

  5. #5
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    The 2 different xmlpackages have different SQL queries which return different data - one of them has the data you want & the other doesn't.


    TTFN

    BFG

  6. #6
    jhoskinson is offline Member
    Join Date
    Feb 2009
    Location
    Los Angeles, CA
    Posts
    36

    Default thanks..

    I figured that was where the problem was... but I haven't a clue how to edit the entity.gridwithprices.xml.config sql query so that it will grab SkuSuffix for each product in the category.

    Any suggestions?

  7. #7
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    SKUSuffix is actually a variant field - so you actually need to grab the SKUSuffix for each variant of each product in the category.

    That xmlpackage as default uses a stored procedure (aspdnsf_GetProducts) so you'd need to modify that (or write an SQL query that pulls only the data you actually need).


    TTFN

    BFG

  8. #8
    jhoskinson is offline Member
    Join Date
    Feb 2009
    Location
    Los Angeles, CA
    Posts
    36

    Default thanks... but

    I have no idea how to do that.....

    Where in the manual does it explain how to do that? Or are there other resources online you'd recommend so I can teach myself how to do this?

  9. #9
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    xmlpackages, SQL, xsl & xml.


    TTFN

    BFG

  10. #10
    jhoskinson is offline Member
    Join Date
    Feb 2009
    Location
    Los Angeles, CA
    Posts
    36

    Default maybe this will help...?

    is there something I can just add to this to get SkuSuffix? One line or several lines or does it require a complete rewrite?

    Code:
      <query name="Products" rowElementName="Product">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_GetProducts 
                        @categoryID = @CatID,
                        @sectionID = @SecID,
                        @manufacturerID = @ManID,
                        @distributorID = @DistID,
                        @genreID = @GenreID,
                        @vectorID = @VectorID,
                        @localeName = @locale,
                        @CustomerLevelID = @CustLevelID,
                        @affiliateID = @AffID,
                        @ProductTypeID = @ProdTypeID, 
                        @ViewType = 1,
                        @pagenum = @pgnum,
                        @pagesize = null,
                        @StatsFirst = 0,
                        @publishedonly = 1,
                        @ExcludePacks = 0,
                        @ExcludeKits = 0,
                        @ExcludeSysProds = 0,
                        @InventoryFilter = @InvFilter,
                        @sortEntityName = @entityname
                ]]>
            </sql>
            <queryparam paramname="@CatID"       paramtype="runtime"   requestparamname="CatID"                                         sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@SecID"       paramtype="runtime"   requestparamname="SecID"                                         sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@ManID"       paramtype="runtime"   requestparamname="ManID"                                         sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@DistID"      paramtype="runtime"   requestparamname="DistID"                                        sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@GenreID"     paramtype="runtime"   requestparamname="GenreID"                                       sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@VectorID"    paramtype="runtime"   requestparamname="VectorID"                                      sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@locale"      paramtype="runtime"   requestparamname="LocaleSetting"                                 sqlDataType="varchar" defvalue="en-US"  validationpattern="" />
            <queryparam paramname="@CustLevelID" paramtype="runtime"   requestparamname="CustomerLevelID"                               sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@AffID"       paramtype="runtime"   requestparamname="AffiliateID"                                   sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@ProdTypeID"  paramtype="runtime"   requestparamname="ProductTypeFilterID"                           sqlDataType="int"     defvalue="1"      validationpattern="" />
            <queryparam paramname="@pgnum"       paramtype="request"   requestparamname="pagenum"                                       sqlDataType="int"     defvalue="1"      validationpattern="" />
            <queryparam paramname="@InvFilter"   paramtype="appconfig" requestparamname="HideProductsWithLessThanThisInventoryLevel"    sqlDataType="int"     defvalue="0"      validationpattern="" />
            <queryparam paramname="@entityname"  paramtype="runtime"   requestparamname="EntityName"                                    sqlDataType="varchar" defvalue=""       validationpattern="" />
        </query>

  11. #11
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default

    The sql query:

    <!-- Needed to show variant info -->
    <query name="Variants" rowElementName="Variant">
    <sql>
    <![CDATA[
    SELECT * FROM ProductVariant PV WITH(NOLOCK)
    WHERE PV.ProductID = @ProductID
    AND PV.Published = 1 AND PV.Deleted = 0
    ]]>
    </sql>
    <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
    </query>
    <!-- Needed to show variant info -->


    In the variant template: <xsl:template name="Variant">

    <xslaram name="pName" select="aspdnsf:GetMLValue(Name)"/>
    <xslaram name="vName" select="aspdnsf:GetMLValue(VariantName)"/>
    <xslaram name="vDescription" select="aspdnsf:GetMLValue(VariantDescription)"/>
    <xslaram name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"/>
    <!-- Needed to show variant info -->
    <xslaram name="vID" select="VariantID"/>
    <xslaram name="vID2" select="VariantID2"/>
    <xslaram name="vID3" select="VariantID3"/>
    <xslaram name="vID4" select="VariantID4"/>



    In the variant HTML:


    <xsl:value-of select="$vDescription" disable-output-escaping="yes"/>
    <xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ManufacturerPartNumber" disable-output-escaping="yes"/>
    <xsl:value-of select="SkuSuffix"/>
    <xsl:value-of select="$vName" disable-output-escaping="yes" />
    <xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ManufacturerPartNumber" disable-output-escaping="yes"/>
    <xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ExtensionData" disable-output-escaping="yes"/>
    <xsl:value-of select="/root/Variants/Variant[VariantID=$vID]/ExtensionData2" disable-output-escaping="yes"/>


    Let me know if it helped. I am using ML Version 8.104