Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Modify ParameterValue in an XmlUrlDataSource to filter query

$
0
0

Hello,

I have a pair of SharePoint Site Pages to display Work Order data from my ERP and link Work Instructions from a SharePoint Document Library.  The first page contains a list of the open Work Orders as queried via an XmlUrlDataSource connection.  It works fine. I need to send a parameter value from the Work Orders page to the Work Order Details page which displays the information for a single work order.  I can do this via a web part connection. 

The trouble is that I need to pre-filter the query for details because the ERP web service limits the number of results provided by a single query, so I cannot query all details from all work orders and then use the XSL to filter the display.  The additional trouble is that there is no exact match parameter I can send from the Work Orders page that can act as a standalone DataFormParameter on the Work Order Details page.  That is, I can send the work order number like this (abstracted):

http//mycompany.sharepoint.com/sites/production/SitePages/Work%20Order%20Detail.aspx?OrderID=110010

But the data source query needs the OrderID to be part of an Odata filter URI like this:

http//myerpdomain.com/WorkOrders?$filter=ShopOrderNumber+eq+110010

So when I create a the XmlUrlDataSource like this:

<SharePoint:XmlUrlDataSource runat="server" AuthType="Basic" HttpMethod="GET" selectcommand="http//myerpdomain.com/WorkOrders"><SelectParameters><WebPartPages:DataFormParameter Name="$filter" ParameterKey="filter" PropertyName="ParameterValues" DefaultValue="ShopOrderNumber eq 110010"/></SelectParameters></SharePoint:XmlUrlDataSource>

I need the value of "filter" to be "ShopOrderNumber+eq+{$OrderID}", but I can't figure out how to get the extra string into the parameter. I have ParamterBindings set up for "filter" and the "OrderID" Query string, but I need help bridging the gap. 

<ParameterBinding Name="filter" Location="Postback;Connection" DefaultValue="ShopOrderNumber+eq+110010"/>

<ParameterBinding Name="PassOrderID" Location="QueryString(OrderID)" DefaultValue="110018"/>

I can create the string I need in xsl, but then it is not in the right namespace to plug into "filter"

 <xsl:variable name="filter2">ShopOrderNumber+eq+<xsl:value-of select="$PassOrderID"/></xsl:variable>
 <xsl:param name="filter"><xsl:value-of select="$filter2"/></xsl:param>

Please let me know what magic I am missing.

Thank you!


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>