Sunday 15 May 2011

sharepoint - CAML Filtering on the Server Side -



sharepoint - CAML Filtering on the Server Side -

i have filter coming location (let's say, query string):

<parameterbinding name="param" location="querystring(param)"/>

i know how pass parameter caml query, like:

<where> <eq> <fieldref name='somefield'/> <value type='text'>{param}</value> </eq> </where>

however, if parameter not supplied, nil (somefield = '').

i wondering: possible have parameters field values in caml? example, know doesn't work, idea:

<where> <or> <eq> <fieldref name='somefield'/> <value type='text'>{param}</value> </eq> <eq> <fieldref formula='{param}'/> <value type='text'></value> </eq> </or> </where>

i know according caml schema, doesn't seem possible. way, have server-side filtering. alternative xsl client-side, means, more records retrieved necessary.

yes, know programmatically, not intent. wish utilize xsltlistviewwebpart.

any thoughts? alternatives?

got it:

<where> <or> <geq> <fieldref name='somefield'/> <value type='number'>{param}</value> </geq> <contains> <fieldref name='author'/> <value type='text'><![cdata[{param}]]></value> </contains> </or> </where>

the trick have in sec status true. in case, if {param} not supplied, '', , contained author (created by) field, not empty. problem had surround {param} , otherwise, won't work.

sharepoint sharepoint-designer

No comments:

Post a Comment