Feeds:
Articoli
Commenti

Posts Tagged ‘Sharepoint’

Will you filter a List View of sharepoint by a value of a managed metadata field ? This isn’t a easy task to do because Managed Metadata fields aren’t filterable.

There is a workaround you can apply with Sharepoint Designer. Open the list form you wish customize with the Designer, select the View (XSLListViewWebPart, XLV WP) and look in code pane for the CAML query section, like this:

    <Query>
     <OrderBy>
      <FieldRef Name=”Modified” Ascending=”FALSE”/>
     </OrderBy>
    </Query>

Then insert the code (ref.: http://msdn.microsoft.com/en-us/library/ff625182.aspx):

    <Query>

<Where><Eq><FieldRef LookupId=”TRUE” Name=”Column_Name” /><Value Type=”Integer”>wssId</Value></Eq></Where>

      <OrderBy>
      <FieldRef Name=”Modified” Ascending=”FALSE”/>
     </OrderBy>
    </Query>

The Column_Name is the internal name of your Managed Metadata Field in your List . In most cases the internal name is the same of Display name of the field. You can check this on List Settings, then click on field and picking the “Field=” value in Url of the browser.

 wssId is the ID of the Term Value you want filter to. How can you  find that ID ?  Make sure your Term Value is used at least once in some lists of the siteCollection, then navigate with browser to /Lists/TaxonomyHiddenList/Allitems.aspx of site collection, find your Term, and pick the ID parameter  from the Url of the term link and you are done. (if term is never used in site collection you will not find the term in hidden List)

Read Full Post »