Issue when filtering with Managed Metadata Columns in Share Point Document Library

Hi All
I have a document library, and a four Metadata Columns in it, with each column having a number of term in it. I have no issues in adding a document or in term sets. We have set property of Managed Metadata Column as Allow Multiple Values. So some of the items
in library contains values with only one term set. While other documents contains values with multiple values.
We have a number of country sites having the document library  with same metadata columns. In document library default view i am showing Metadata column, User want to filter the documents (view) based on Metadata column selected.
The filtering is giving inconsistent behavior. In production server it is giving in error with some correlation ID. On our development machine some times it is working fine and some other times it is given error of Validation of Viewstate MAC failed. i tried
on different countries sites.
I checked we have already kept the Metadata Navigation and Filtering under site action feature as activated. It was even more weird when i deactivated the feature on one country site and the filtering was working fine. And on other country site where i
kept the feature as activated and the filtering was giving an error.
Thanks & Regards
Amit

Hi Amit,
Have you checked the ULS error message for more information with correlation ID?
Please try using the library metadata navigation to filter these managed metadata columns value via configuring library "Metadata navigation settings" after you enabled the "Metadata Navigation and Filtering" feature,
then check if the issue would still persist.
Please see more information from below article with similar issue.
http://blog.tippoint.net/filter-by-managed-metadata-field-in-asset-picker-dialog/
Thanks,
Daniel Yang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you havefeedback for TechNet Subscriber Support, contact [email protected] 
Daniel Yang
TechNet Community Support

Similar Messages

  • Provision a document library definition with managed metadata column using Visual Studio 2010 designer

    hi all,
    how can i create a document library with a managed metadata column and lookup column .
     what  should be the  type for managed metadata column ? is it "Taxonomy", if yes how can i enter the term set values which should be populated by default.
    also would like to know how to refer the parent list / column[field] in the loopkup field
    help is appreciated!
    thnx

    Hi,
    To add a Managed Metadata field into the list definition, you can take a look at the link below with steps in details about the same requirement.
    http://gheckoplus.blogspot.com/2011/10/how-to-sharepoint-2010-list-definition.html
    For the Lookup field:
    http://abdulazizfarooqi.wordpress.com/2012/08/17/provisioning-lookup-field-in-sharepoint-2010-lookup-field-in-the-list-in-sharepoint-2010/
    http://ronsp.wordpress.com/2011/04/27/declaratively-adding-a-lookup-field-to-a-list-schema-using-customschema-attribute-in-listinstance/
    What’s more, if you have several questions to ask, I suggest you post them into every single thread to make them easier to be discussed in the forum.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Grouping by a Metadata Column in a SharePoint Document Library

    Hi All,
    I have a document library with a managed metadata column. Now I need to create a view in which i need to group by the metadata column but I'm not able to see the managed metadata column in the Group By Columns list. Is it possible to accomplish this? Can
    anyone pls help me out. Thank you.

    It's kind of a lot of code... but here goes!
    This all goes into a separate JS file:
    (Tip, to copy this code chunk, it's easiest to start your selection outside the code block)
    var js_MultiFilter = (function () {
    function js_MultiFilter(listName, site) {
    this.document = document; f (typeof listName == "undefined") { listName = 'Documents'; }if (typeof site == "undefined") { this.useCurrentSite = true; }else { this.useCurrentSite = false; }this.listName = listName;this.listRootfolder = "";this.site = site;this.notificationEnabled = true;this.filterFields = []; this.filterNames = []; this.selectModes = []; this.filterValueLists = []; this.displayFields = []; this.displayNames = []; this.displayModes = []; this.items = []; this.potentialFilters = []; this.queryFields = []; this.selectedFilters = []; this.sortField = "Title"; this.sortDesc = false; this.selectMode = "checkbox"; this.filterHeadingClass = "js_MFFilterHeading"; this.filterTableClass = "js_MFFilterTable"; this.filterColumnClass = "js_MFFilterColumn"; this.innerFilterColumnClass = "js_MFInnerFilterColumn"; this.filterCheckboxClass = "js_MFFilterCell"; this.displayOuterClass = "js_MFResultOuter"; this.displayTableClass = "js_MFResultTable"; this.displayRowClass = "js_MFResultRow";
    this.displayHeaderClass = "js_MFResultHeader"; this.displayCellClass = "js_MFResultCell"; this.filterLabelClass = "js_MFFilterLabel"; this.filterLabelHoverClass = "js_MFFilterHoverLabel"; this.filterLabelSelectClass = "js_MFFilterSelectLabel"; this.filterLabelUnusedClass = "js_MFFilterUnusedLabel"; this.resultCountClass = "js_MFResultCount"; this.maxResultHeight = "270px"; this.rowLimit = 100; this.divId; this.evenColumnWidths = true; this.evenFilterColumnWidths = true; this.resultsId = "js_MultiFilterResults1"; this.showMetadataGuids = false; this.maxFilterHeight = 13;
    /*Methods*/ this.containsString = containsString; this.getIndexOf = getIndexOf; this.addDisplayField = addDisplayField; this.addStaticDisplayField = addStaticDisplayField; this.addFilterField = addFilterField; this.bindToDiv = bindToDiv; this.onQuerySucceeded = onQuerySucceeded; this.onQueryFailed = onQueryFailed; this.getValueAsString = getValueAsString; this.showLoading = showLoading; this.removeLoading = removeLoading; this.toggleAndApplyFilter = toggleAndApplyFilter; this.applyFilter = applyFilter; this.insertDefaultCss = insertDefaultCss; this.get_defaultCss = get_defaultCss; this.isPageInEditMode = isPageInEditMode; this.HoverFilterLabel = HoverFilterLabel; this.DeHoverFilterLabel = DeHoverFilterLabel;
    /*Interface Functions*/
    function isPageInEditMode() { return (document.forms[0].elements["MSOLayout_InDesignMode"].value == "1") }
    function addFilterField(fieldName, displayName, selectMode) { if (typeof (displayName) == "undefined") { displayName = fieldName; } if (typeof (selectMode) == "undefined") { selectMode = this.selectMode; } this.filterFields.push(fieldName); this.filterNames.push(displayName); this.selectModes.push(selectMode.toString().toLowerCase()); var filterValueList = []; this.filterValueLists.push(filterValueList); var potFilterValueList = []; this.potentialFilters.push(potFilterValueList); if (!this.containsString(this.queryFields, fieldName)) { this.queryFields.push(fieldName); } }
    function addDisplayField(fieldName, displayName, displayMode) { if (typeof (displayName) == "undefined") { displayName = fieldName; } if (typeof (displayMode) == "undefined") { displayMode = "default"; } this.displayFields.push(fieldName); this.displayNames.push(displayName); this.displayModes.push(displayMode); if (!this.containsString(this.queryFields, fieldName)) { this.queryFields.push(fieldName); } }
    function addStaticDisplayField(displayText, displayName, displayMode) { if (typeof (displayName) == "undefined") { displayName = displayText; } if (typeof (displayMode) == "undefined") { displayMode = "default"; } this.displayFields.push("@" + displayText); this.displayNames.push(displayName); this.displayModes.push(displayMode); }
    function insertDefaultCss(RevertToDefaultStyles) { var js_style = this.document.createElement("style"); js_style.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(js_style); var newCss = this.get_defaultCss(RevertToDefaultStyles); if (typeof js_style.styleSheet != "undefined") { js_style.styleSheet.cssText = newCss; } else { js_style.appendChild(this.document.createTextNode(newCss)); } }
    function bindToDiv(divId) { /* Causes the control to appear in the specified div.*/ if (typeof (divId) != "undefined") { this.divId = divId; } if (this.notificationEnabled) { showLoading(this); } var clientContext; if (this.useCurrentSite) { clientContext = new SP.ClientContext.get_current(); } else { clientContext = new SP.ClientContext(this.site); } var web = clientContext.get_web(); var lists = web.get_lists(); var list = lists.getByTitle(this.listName); var camlQuery = new SP.CamlQuery(); var descending = ""; if (this.sortDesc) { descending = " Ascending='False'"; } var camlString = '<View><Query><OrderBy><FieldRef Name=\'' + this.sortField + '\'' + descending + '/></OrderBy></Query><RowLimit>' + this.rowLimit + '</RowLimit></View>'; camlQuery.set_viewXml(camlString); this.collListItem = list.getItems(camlQuery); var strFields = "ID,"; if (containsString(this.displayModes, "fileref", true)) { strFields += "FileRef," }
    for (var i = 0; i < this.queryFields.length; i++) { strFields += this.queryFields[i] + ","; } strFields = strFields.substring(0, strFields.length - 1); this.listRootfolder = list.get_rootFolder(); clientContext.load(this.listRootfolder); clientContext.load(this.collListItem, "Include(" + strFields + ")"); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); }
    function showLoading(parent) { parent.notifyId = SP.UI.Notify.addNotification("Loading...", true); }
    function removeLoading(parent) { SP.UI.Notify.removeNotification(parent.notifyId); }
    function getValueAsString(fieldValue, activeHyperlinks, showLinkUrl, displayMode, additionalFieldValue) { var localNull = null; if (typeof (displayMode) == "undefined") { displayMode = "default"; } /*wraps hyperlink text in <a> tag*/ if (typeof (activeHyperlinks) == "undefined") { activeHyperlinks = false; } /*causes hyperlinks to display URL by default instead of description*/ if (typeof (showLinkUrl) == "undefined") { showLinkUrl = true; } var returnValue = []; var isArray = false if (typeof (fieldValue) == "object" && fieldValue != localNull) { if (fieldValue[0] != localNull) { if (fieldValue.length) { for (var i = 0; i < fieldValue.length; i++) { returnValue.push(this.getValueAsString(fieldValue[i])); isArray = true; } } } } if (!isArray) { if (fieldIsText(fieldValue)) { if (displayMode.toString().toLowerCase() == "link") { returnValue = '<a href="' + fieldValue + '">' + fieldValue + '</a>'; }
    else if (displayMode.toString().toLowerCase() == "display") { returnValue = '<a href="' + this.listRootfolder.get_serverRelativeUrl() + '/Forms/DispForm.aspx?ID=' + additionalFieldValue + '">' + fieldValue + '</a>'; } else if (displayMode.toString().toLowerCase() == "edit") { returnValue = '<a href="' + this.listRootfolder.get_serverRelativeUrl() + '/Forms/EditForm.aspx?ID=' + additionalFieldValue + '">' + fieldValue + '</a>'; } else if (displayMode.toString().toLowerCase() == "fileref") { returnValue = '<a href="' + additionalFieldValue + '">' + fieldValue + '</a>'; } else { returnValue = fieldValue; } } else { if (fieldValue == localNull) { returnValue = ""; } else { if (fieldIsDate(fieldValue)) { returnValue = fieldValue._toFormattedString(); } else { if (fieldIsHyperlink(fieldValue)) { var desc = fieldValue.get_description(); var url = fieldValue.get_url(); if (showLinkUrl) { if (url != localNull) { returnValue = url; } else { if (desc != localNull) { returnValue = desc; } } }
    else { if (desc != localNull) { returnValue = desc; } else { if (url != localNull) { returnValue = url; } } } if (activeHyperlinks && url != localNull) { returnValue = '<a href="' + url + '">' + returnValue + '</a>'; } } else { if (fieldIsLookup(fieldValue)) { if (displayMode.toString().toLowerCase() == "link") { returnValue = '<a href="' + fieldValue.get_lookupValue() + '">' + fieldValue.get_lookupValue() + '</a>'; } else { if(fieldValue.get_lookupValue() == ""){ /* When doing a lookup count, the lookup ID is used */ returnValue = fieldValue.get_lookupId(); }else{ returnValue = fieldValue.get_lookupValue(); } } } else { returnValue = ""; } } } } } } return returnValue; }
    function onQuerySucceeded(sender, args) { var listItemEnumerator = this.collListItem.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); var localNull = null; var item = new Object(); item.filterValues = []; item.displayValues = []; for (var i = 0; i < this.filterFields.length; i++) { var filterValue = []; /*Collect all filter values*/ var rawValue = this.getValueAsString(oListItem.get_item(this.filterFields[i])); if (typeof (rawValue) == "string") { filterValue.push(rawValue); } else { filterValue = rawValue; } for (var k = 0; k < filterValue.length; k++) { /*if this value hasn't been encountered before, add it to our filter value list for this filter field*/ var thisvalue = filterValue[k]; if (this.showMetadataGuids == false) { if (thisvalue.indexOf('|') != -1) { thisvalue = thisvalue.split('|')[0]; } } if (!containsString(this.filterValueLists[i], thisvalue)) { this.filterValueLists[i].push(thisvalue); } } item.filterValues.push(filterValue); }
    for (var j = 0; j < this.displayFields.length; j++) { var initialValue = this.displayFields[j]; if (initialValue.startsWith("@")) { initialValue = initialValue.substring(initialValue.indexOf("@") + 1); } else { initialValue = oListItem.get_item(this.displayFields[j]) } /*Collect all display values*/ if (this.displayModes[j] == "fileref") { var displayValue = this.getValueAsString(initialValue, true, false, this.displayModes[j], oListItem.get_item("FileRef")); } else { var displayValue = this.getValueAsString(initialValue, true, false, this.displayModes[j], oListItem.get_item("ID")); } item.displayValues.push(displayValue); } this.items.push(item); } var filterSelectBoxes = []; for (var i = 0; i < this.filterFields.length; i++) { var selectbox = this.document.createElement("div"); selectbox.className = this.filterColumnClass; selectbox.setAttribute("index", i); var heading = this.document.createElement("div"); heading.className = this.filterHeadingClass;
    heading.innerHTML = this.filterNames[i]; selectbox.appendChild(heading); var columnContainer = document.createElement("div"); selectbox.appendChild(columnContainer); var innerColumns = []; for (var j = 0; j < this.filterValueLists[i].length; j += this.maxFilterHeight) { var innerColumn = document.createElement("div"); innerColumn.className = this.innerFilterColumnClass; innerColumns.push(innerColumn); columnContainer.appendChild(innerColumn); } this.filterValueLists[i].sort(); for (var j = 0; j < this.filterValueLists[i].length; j++) { var input = document.createElement("input"); input.type = this.selectModes[i]; input.className = this.filterCheckboxClass; var checkboxText = this.filterValueLists[i][j]; input.setAttribute("name", this.filterFields[i]); input.id = "js_mf_" + i + "_" + j; var labelid = "label_" + i + "_" + j; input.setAttribute("label", labelid); input.value = checkboxText; var checkboxlabel = document.createTextNode(checkboxText); var checkboxlabelspan = document.createElement("span");
    checkboxlabelspan.className = this.filterLabelClass; checkboxlabelspan.id = labelid; checkboxlabelspan.setAttribute("checkbox", input.id); checkboxlabelspan.appendChild(checkboxlabel); var parent = this;
    /*ADD EVENT HANDLER*/ if (input.addEventListener) { /*chrome, firefox, and new IE*/ input.addEventListener("change", function (element) { parent.applyFilter(element, parent) }); input.addEventListener("click", function (element) { parent.applyFilter(element, parent) }); checkboxlabelspan.addEventListener("click", function (element) { parent.toggleAndApplyFilter(element, parent) }); checkboxlabelspan.addEventListener("mouseenter", function (element) { parent.HoverFilterLabel(element, parent) }); checkboxlabelspan.addEventListener("mouseout", function (element) { parent.DeHoverFilterLabel(element, parent) }); } else { /*legacy internet explorer*/ input.attachEvent("onchange", function (element) { parent.applyFilter(element, parent) }); input.attachEvent("onclick", function (element) { parent.applyFilter(element, parent) }); checkboxlabelspan.attachEvent("onclick", function (element) { parent.toggleAndApplyFilter(element, parent) });
    checkboxlabelspan.attachEvent("onmouseenter", function (element) { parent.HoverFilterLabel(element, parent) }); checkboxlabelspan.attachEvent("onmouseout", function (element) { parent.DeHoverFilterLabel(element, parent) }); } var currentColumnIndex = 0; for (var k = 0; k < innerColumns.length; k++) { if (j >= k * this.maxFilterHeight) currentColumnIndex = k; } var currentColumn = innerColumns[currentColumnIndex]; currentColumn.appendChild(input); currentColumn.appendChild(checkboxlabelspan); currentColumn.appendChild(document.createElement("br")); } filterSelectBoxes.push(selectbox); } var htmlToWrite = document.createElement("div"); htmlToWrite.className = this.filterTableClass; for (var i = 0; i < filterSelectBoxes.length; i++) { htmlToWrite.appendChild(filterSelectBoxes[i]); }
    /*clear the loading image and add our filters*/ document.getElementById(this.divId).innerHTML = ""; document.getElementById(this.divId).appendChild(htmlToWrite);
    /*Create the div to display the results*/ var detailsDiv = document.createElement("div"); detailsDiv.className = this.displayOuterClass; var detailIdstring = "Details"; iterator = 0; var detailsId = detailIdstring + iterator; while (this.document.getElementById(detailsId) != localNull) { iterator = iterator + 1; detailsId = detailIdstring + iterator; } detailsDiv.id = detailsId; this.resultsId = detailsId;
    /*create a div for a row within the results table*/ var detailDiv = document.createElement("div"); detailDiv.className = this.displayRowClass; detailDiv.appendChild(document.createTextNode("<img src='/_layouts/images/loading.gif' />")); detailsDiv.appendChild(detailDiv);
    /*Add the results below the filters*/ document.getElementById(this.divId).appendChild(detailsDiv); for (var i = 0; i < this.filterFields.length; i++) { var selectedFieldArray = []; this.selectedFilters.push(selectedFieldArray); } if (this.notificationEnabled) { this.removeLoading(this); } applyFilter(null, this); }
    function DeHoverFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } else if (sourcelabel.getAttribute("unused") == "unused") { sourcelabel.className = parent.filterLabelUnusedClass; } else { sourcelabel.className = parent.filterLabelClass; } }
    function SelectFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; hover = false; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } }
    function HoverFilterLabel(labelel, parent) { var sourcelabel = labelel.srcElement; var hover = true; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); if (el.checked) { sourcelabel.className = parent.filterLabelSelectClass; } else if (sourcelabel.getAttribute("unused") == "unused") { sourcelabel.className = parent.filterLabelUnusedClass; } else if (hover) { sourcelabel.className = parent.filterLabelHoverClass; } else { sourcelabel.className = parent.filterLabelClass; } }
    function toggleAndApplyFilter(labelel, parent) { var sourcelabel = labelel.srcElement; if (typeof (sourcelabel) == "undefined") { sourcelabel = labelel; } var checkboxid = sourcelabel.getAttribute("checkbox"); var el = document.getElementById(checkboxid); var select = false; if (el.checked) { el.checked = false; } else { el.checked = true; select = true; } parent.applyFilter(el, parent); if (select) { sourcelabel.className = parent.filterLabelSelectClass; } else { sourcelabel.className = parent.filterLabelHoverClass; } }
    function applyFilter(el, parent) { var localNull = null; var resultcount = 0; if (el != localNull) { var element = el.srcElement; if (typeof (element) == "undefined") { element = el; } SelectFilterLabel(document.getElementById(element.getAttribute("label")), parent); var filter = element.value; var parentNode = element.parentNode; var tempElement = element.parentNode; while (tempElement.getAttribute("index") == localNull) { tempElement = tempElement.parentNode; } var fieldIndex = tempElement.getAttribute("index"); var elements = document.getElementsByName(element.getAttribute("name")); for (var inc = 0; inc < elements.length; inc++) { var thisel = elements[inc]; if (typeof (thisel.getAttribute("label")) != "undefined") { DeHoverFilterLabel(document.getElementById(thisel.getAttribute("label")), parent); } } if (element.checked) {
    if (parent.selectModes[fieldIndex] == "radio") { /*remove all other filters in this field.*/ parent.selectedFilters[fieldIndex] = []; } if (!containsString(parent.selectedFilters[fieldIndex], filter)) { parent.selectedFilters[fieldIndex].push(filter); } } else { var index = getIndexOf(parent.selectedFilters[fieldIndex], filter); if (typeof (index) != "undefined") { parent.selectedFilters[fieldIndex].splice(index, 1); } } } var resultsOuterDiv = document.createElement("div"); resultsOuterDiv.className = parent.displayTableClass; document.getElementById(parent.resultsId).innerHTML = ""; document.getElementById(parent.resultsId).appendChild(resultsOuterDiv); var resultsHeaderDiv = document.createElement("div"); resultsHeaderDiv.className = parent.displayRowClass; for (var i = 0; i < parent.displayNames.length; i++) { var headerCell = document.createElement("div"); headerCell.className = parent.displayHeaderClass; headerCell.innerHTML = parent.displayNames[i]; resultsHeaderDiv.appendChild(headerCell); }
    resultsOuterDiv.appendChild(resultsHeaderDiv); for (var i = 0; i < parent.potentialFilters.length; i++) { parent.potentialFilters[i] = []; /*initialize an array of empty arrays (one per filter)*/ } for (var i = 0; i < parent.items.length; i++) { /*for each item...*/ var itemfields = parent.items[i].filterValues var itemContainsAllSelectedValues = true; for (var j = 0; j < parent.selectedFilters.length; j++) { /*for each filter field*/ for (var k = 0; k < parent.selectedFilters[j].length; k++) { /*for each selected filter value*/ if (parent.selectedFilters[j].length == 0) continue; /*skip it if nothing is selected.*/ var thisvalue = parent.items[i].filterValues[j]; /*check if the item has that value within that field*/ if (!containsString(thisvalue, parent.selectedFilters[j][k], this.showMetadataGuids)) { itemContainsAllSelectedValues = false; break; } if (!itemContainsAllSelectedValues) break; } }
    if (itemContainsAllSelectedValues) { resultcount++; var rowDiv = document.createElement("div"); rowDiv.className = parent.displayRowClass; for (var j = 0; j < parent.items[i].displayValues.length; j++) { var cellDiv = document.createElement("div"); cellDiv.className = parent.displayCellClass; cellDiv.innerHTML = parent.items[i].displayValues[j]; rowDiv.appendChild(cellDiv); } for (var j = 0; j < parent.items[i].filterValues.length; j++) { for (var k = 0; k < parent.items[i].filterValues[j].length; k++) { parent.potentialFilters[j].push(parent.items[i].filterValues[j][k]); } } resultsOuterDiv.appendChild(rowDiv); } } if (resultcount == 0) { var rowDiv = document.createElement("div"); rowDiv.className = parent.displayRowClass; var cellDiv = document.createElement("div"); cellDiv.className = parent.displayCellClass; cellDiv.innerHTML = "No results were found for the specified criteria."; rowDiv.appendChild(cellDiv); resultsOuterDiv.appendChild(rowDiv); }
    /*Stylize dead-end filter options*/ for (var i = 0; i < parent.filterValueLists.length; i++) { for (var j = 0; j < parent.filterValueLists[i].length; j++) { var labelid = "label_" + i + "_" + j; var checkboxid = "js_mf_" + i + "_" + j; var filterCheck = document.getElementById(checkboxid); var fieldValue = parent.filterValueLists[i][j]; var tempElement = filterCheck.parentNode; while (tempElement.getAttribute("index") == localNull) { tempElement = tempElement.parentNode; } var fieldIndex = tempElement.getAttribute("index"); if (!containsString(parent.potentialFilters[fieldIndex], fieldValue, parent.showMetadataGuids)) { document.getElementById(labelid).className = parent.filterLabelUnusedClass; document.getElementById(labelid).setAttribute("unused", "unused"); } else { if (document.getElementById(checkboxid).checked) { document.getElementById(labelid).className = parent.filterLabelSelectClass; } else { document.getElementById(labelid).className = parent.filterLabelClass; }
    document.getElementById(labelid).setAttribute("unused", "false"); } } } var resultCountId = "js_mf_resultcount"; var resultCountDiv; if (document.getElementById(resultCountId) == null) { resultCountDiv = document.createElement("div"); resultCountDiv.id = "js_mf_resultcount"; resultCountDiv.className = parent.resultCountClass; document.getElementById(parent.divId).appendChild(resultCountDiv) } else { resultCountDiv = document.getElementById(resultCountId); } if (resultcount == 1) { resultCountDiv.innerHTML = resultcount + " result"; } else { resultCountDiv.innerHTML = resultcount + " results"; } }
    function onQueryFailed(sender, args) { this.removeLoading(this); this.document.getElementById(this.divId).innerHTML = 'The page was unable to populate the data this time.' + '<br/><span style="color:white">' + args.get_message() + '</span>\n'; }
    function get_defaultCss(useTheseClasses, includeStyleTags) { if (typeof useTheseClasses != "boolean") useTheseClasses = true; if (useTheseClasses) { this.filterHeadingClass = "js_Heading"; this.filterTableClass = "js_MFFilterTable"; this.filterColumnClass = "js_MFFilterColumn"; this.filterCheckboxClass = "js_MFFilterCell"; this.displayOuterClass = "js_MFResultOuter"; this.displayTableClass = "js_MFResultTable"; this.displayRowClass = "js_MFResultRow"; this.displayHeaderClass = "js_MFResultHeader"; this.displayCellClass = "js_MFResultCell"; this.filterLabelClass = "js_MFFilterLabel"; } if (typeof includeStyleTags != "boolean") includeStyleTags = false; var openstyletag = ""; var closestyletag = ""; if (includeStyleTags) { openstyletag = "<style>"; closestyletag = "</style>"; } var leftright_padding = "padding-left:2px;padding-right:2px;"; var tableLayoutFixed = ""; var filterTableLayoutFixed = ""; if (this.evenColumnWidths || this.dockResultHeaders) { tableLayoutFixed = "table-layout:fixed; "; }
    if (this.evenFilterColumnWidths) { filterTableLayoutFixed = "table-layout:fixed; "; } return openstyletag + "." + this.filterHeadingClass + "{font-weight:bold;background:#DDDDDD;text-align:center;}." + this.filterTableClass + "{background:#EEEEEE;display:table;width:100%;"+filterTableLayoutFixed+"}." + this.filterColumnClass + "{ display:table-cell;border-left:1px solid #CCC; border-right:1px solid #CCC;}." + this.filterCheckboxClass + "{padding-left: 5px;}." + this.displayOuterClass + "{height:" + this.maxResultHeight + "; overflow:auto; border:1px solid #CCC;}." + this.displayTableClass + "{display:table; " + tableLayoutFixed + "width:100%; text-align:left;}." + this.displayRowClass + "{width:100%;text-align:left;display:table-row;border-bottom:1px solid #EEEEEE;}." + this.displayHeaderClass + "{background:gray;color:white;display:table-cell; padding:5px; font-weight:bold;}." + this.displayCellClass + "{border-right:solid #CCC 1px; " + "border-left:0px;border-top:0px;border-bottom:1px solid #EEEEEE;"
    + "display:table-cell;padding:5px;}." + this.innerFilterColumnClass + "{float:left;}." + this.filterLabelClass + "{margin:1px; cursor:pointer;" + leftright_padding + "}." + this.filterLabelHoverClass + "{cursor:pointer; margin:1px;text-decoration:underline;" + leftright_padding + "}." + this.filterLabelSelectClass + "{background: #555; color:white; cursor:pointer; border:1px solid #555;" + leftright_padding + "}." + this.filterLabelUnusedClass + "{color:#bbb;margin:1px;cursor:default;" + leftright_padding + "}." + this.resultCountClass + "{text-align:right;font-weight:bold;}" + closestyletag; }
    function fieldIsLookup(field) { return (typeof field.get_lookupValue == 'function'); }
    function fieldIsDate(field) { return (typeof field._toFormattedString == 'function'); }
    function fieldIsHyperlink(field) { return (typeof field.get_url == 'function'); }
    function fieldIsText(field) { return (typeof field == 'string'); }
    /* HELPER FUNCTIONS*/
    /* Helper function to imitate Array.contains() method */ function containsString(strArray, text, showMetadataGuids) { if (typeof (showMetadataGuids) == "undefined") { showMetadataGuids = true; } var contains = false; for (i in strArray) { if (strArray[i] == text) { contains = true; break; } else if (showMetadataGuids == false) { if (strArray[i].indexOf('|') != -1) { if (strArray[i].split('|')[0] == text) { contains = true; break; } } } } return contains; }
    /* Helper function to imitate Array.indexOf() method */ function getIndexOf(strArray, text) { for (i in strArray) { if (strArray[i] == text) return i; } }
    return js_MultiFilter;})();
    Then you can reference the JS file and put the filter control on your page like so:
    <div id="js_MultiFilterExample"><img src="/_layouts/images/loading.gif"/></div>
    <script src="/[wherever you saved your js file]/js_MultiFilter.js"></script>
    <script>
    ExecuteOrDelayUntilScriptLoaded(newInstance, "sp.js");
    function newInstance(){
    var mf = new js_MultiFilter("Library Name"); // pass the list display name
    //// Optional Parameters
    //mf.maxResultHeight = "100%"; // set the max height of the results (default: "270px")
    mf.sortField = "FileLeafRef"; // specify internal name of field to sort results by (default: Title)
    //mf.sortDesc = true; // sort descending (default: false)
    //mf.evenColumnWidths = false; // equal result column widths (disable at own risk) (default: true)
    mf.evenFilterColumnWidths = false; // equal filter column widths (default: true)
    //mf.rowLimit = 500; // increase the result row limit imposed on the query (default: 100)
    //mf.notificationEnabled = false; // show the fly-out Loading notification (default: true)
    //mf.selectMode = "radio"; // Specify the default select mode i.e. checkbox or radio (default: checkbox)
    //mf.showMetadataGuids = true; // Do not trim the GUID suffix from managed metadata filters (default: false)
    //mf.maxFilterHeight = 20 ; // Specify the maximum number of options to display in a column before adding another column (default: 13)
    //// Filter and Display Fields
    mf.addFilterField("Category","Category","radio"); // (internal name, display name (optional), select mode (optional))
    mf.addFilterField("Tags");
    //// addDisplayField() displays an additional field from each list item
    //// addStaticDisplayField() adds a column that displays the same text for every item
    mf.addDisplayField("FileLeafRef","Link to Doc","fileref"); // (internal name, display name (optional), display mode (optional))
    mf.addStaticDisplayField("View Properties","Display Form","display"); // (display text, display name (optional), display mode (optional))
    mf.addDisplayField("Author","Created By");
    mf.addDisplayField("Modified");
    //// Valid display modes are: default (display value as text), link (treat the value as a hyperlink),
    //// display (link to library display form), edit (link to library edit form), and fileref (link to document)
    //// CSS classes used by the control
    //mf.filterHeadingClass = "js_MFFilterHeading";
    //mf.filterTableClass = "js_MFFilterTable";
    //mf.filterColumnClass = "js_MFFilterColumn";
    //mf.filterInnerColumnClass = "js_MFInnerFilterColumn";
    //mf.filterCheckboxClass = "js_MFFilterCell";
    //mf.displayOuterClass = "js_MFResultOuter";
    //mf.displayTableClass = "js_MFResultTable";
    //mf.displayRowClass = "js_MFResultRow";
    //mf.displayHeaderClass = "js_MFResultHeader";
    //mf.displayCellClass = "js_MFResultCell";
    //mf.filterLabelHoverClass = "js_MFFilterHoverLabel";
    //mf.filterLabelSelectClass = "js_MFFilterSelectLabel";
    //mf.filterLabelUnusedClass = "js_MFFilterUnusedLabel";
    //mf.resultCountClass = "js_MFResultCount";
    mf.insertDefaultCss();
    mf.bindToDiv("js_MultiFilterExample");
    </script>
    Uncomment anything you need to change!

  • Managed metadata columns in document information panel with multiple content types

    Hi everyone,
    The problem I have is that for custom content types not all managed metadata columns are displayed in Document Information Panel (DIP) for the document in the Office client application. 
    However, everything works fine with 1 specific content type. Even though the others using exactly the same site columns. The content types are deployed using visual studio to the content type hub, and after this the content types are correctly published to
    the site collections, there are no publish issues here. 
    When I create a document based on the second content type in the same library, all fields are showed in the document information panel, except the managed metadata columns.
    Detailed explanation:
    Library: procedures
    Content types:
    - simple procedure (with 4 managed metadata fields and some other text fields)
    - procedure with approval (with the same 4 managed metadata fields and some other text fields)
    Scenario 1: I add the 'simple procedure' content type to the procedures library as only content type. Everything works fine, and all fields show correctly in the document information panel in Word.
    Scenario 2: I add the 'procedure with approval' content type to the procedures library as only content type. Everything works fine, and all fields show correctly in the document information panel in Word.
    Scenario 3: I add the 'simple procedure' and 'procedure with approval' content types to the document library procedures (added simple procedure first). When I create a new document based on the 'simple procedure'
    content type, everything works fine and he shows all metadata fields. When I add a new document based on the 'procedure with approval' content type, the document information panel shows correctly, except all managed metadata fields. These are not visible at
    all. Though they worked perfectly in scenario 1 and 2.
    Is this a known issue or is there a workaround for this? 
    Thanks in advance! 
    Kind regards, Davy

    Yes!
    This problem is solved right now.
    My issue was that I'm using custom content types deployed by Visual Studio in the content type hub. To create a managed metadata site column in visual studio, you need to have first of all your managed metadata field, but also a hidden field accompagnied
    to make the actual mapping like the example below:
    <Field ID="{B654D984-187A-471B-8738-F08F3356CFDA}"
    Type="TaxonomyFieldType"
    DisplayName="Countries"
    ShowField="Term1033"
    EnforceUniqueValues="FALSE"
    Group="Demo"
    StaticName="Countries"
    Name="Countries">
    <Customization>
    <ArrayOfProperty>
    <Property>
    <Name>TextField</Name>;
    <Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{67308AC2-9556-456B-BF9E-43E8F23EBEE6}</Value>
    </Property>
    </ArrayOfProperty>
    </Customization>
    </Field>
    <Field Type="Note"
    DisplayName="Countries_0"
    StaticName="CountriesTaxHTField0"
    Name="CountriesTaxHTField0"
    ID="{67308AC2-9556-456B-BF9E-43E8F23EBEE6}"
    ShowInViewForms="FALSE"
    Required="FALSE"
    Hidden="TRUE"
    CanToggleHidden="TRUE"
    Group="Demo"
    RowOrdinal="0"
    />
    </Elements>
    VERY important here is that when you create your content type using visual studio, you not only have to add the managed metadata site column in your xml (which let the content type work already perfectly) but also add the hidden field to your content type
    xml !! This way, SharePoint knows that when you have multiple content types with the same site columns in the same library, the second content type also need to get the hidden field from this site columns like in the example below!
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Document (0x0101) -->;
    <ContentType ID="0x010100571ebc0f478a49d5a775039347ee1535"
    Name="Document Location"
    Group="Demo"
    Description="A content type containing Managed Metadata Column."
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{B654D984-187A-471B-8738-F08F3356CFDA}" Name="Countries"/>
    <FieldRef ID="{67308AC2-9556-456B-BF9E-43E8F23EBEE6}" Name="CountriesTaxHTField0"/>
    <FieldRef ID="{f3b0adf9-c1a2-4b02-920d-943fba4b3611}" Name="TaxCatchAll"/>
    <FieldRef ID="{8f6b6dd8-9357-4019-8172-966fcd502ed2}" Name="TaxCatchAllLabel"/>
    </FieldRefs>
    </ContentType>
    </Elements>
    I'm very happy I found this solution, because in the whole project i'm implementing, this was used a lot!
    Special thanks to the blog of @cann0nf0dder (http://cann0nf0dder.wordpress.com/2013/04/01/creating-a-site-column-with-managed-metadata) which let me think about this! 
    This ticket is answered now! :-)
    Kind regards,
    Davy

  • SharePoint Designer - Data Source Details doesn't show all Managed Metadata Columns

    Hello all,
    I've an issue with SharePoint Designer in combination with managed metadata columns.
    I use content type which uses it total 7 managed meta data (site) columns and additional 20 columns for data.
    I use a dataview and I'm aligning the XSLT for the display of the data.
    In the Data Source Details all other columns will be displayed but from the managed metadata columns 3 columns are missing, they are not shown. So it seems impossible to me to access the data in the XSLT.
    During my investigations i've found out that the columns will be displayed if I change the DataSourceMode="List" to DataSourceMode="ListItems". Nevertheless, the missing columns are still empty even they should contain data.
    Do you have any idea what causes the issue?
    It seems like there is a restriction in SharePoint Designer 2010 and/or SharePoint 2010 with regards to the count for the use of managed metadata columns.
    Would appreciate any help and idea.
    Thanks in advance,
    Stefan

    Hello all,
    I've an issue with SharePoint Designer in combination with managed metadata columns.
    I use content type which uses it total 7 managed meta data (site) columns and additional 20 columns for data.
    I use a dataview and I'm aligning the XSLT for the display of the data.
    In the Data Source Details all other columns will be displayed but from the managed metadata columns 3 columns are missing, they are not shown. So it seems impossible to me to access the data in the XSLT.
    During my investigations i've found out that the columns will be displayed if I change the DataSourceMode="List" to DataSourceMode="ListItems". Nevertheless, the missing columns are still empty even they should contain data.
    Do you have any idea what causes the issue?
    It seems like there is a restriction in SharePoint Designer 2010 and/or SharePoint 2010 with regards to the count for the use of managed metadata columns.
    Would appreciate any help and idea.
    Thanks in advance,
    Stefan

  • Updating a managed metadata column from choice column value

    I am trying loop through
    all lists in a web, and for each list, 
    1. create a managed metadata column->Working
    2.
    Pull value from choice column->Working
    3. Move
    choice column value to managed metadata column->Not Working
    Point number 3 is not working. Please advise
    Here is the code:
    static void Main(string[] args)
    //Pulling the rootweb of the Site
    const string SPLocationListColumn = "CHECK6";
    SPSite site = new SPSite("http://sp2010:8080");
    SPWeb rootweb = site.RootWeb;
    //Setting up the taxonomy terstore, termset and term
    Microsoft.SharePoint.Taxonomy.TaxonomySession taxonomySession = new Microsoft.SharePoint.Taxonomy.TaxonomySession(site);
    TermStore termStore = taxonomySession.TermStores["Managed Metadata Service"];
    Console.WriteLine(termStore.Name);
    Group group = termStore.Groups["KM Metatags"];
    Console.WriteLine(group.Name);
    TermSet termSet = group.TermSets["Document Classification"];
    Guid termsetid = termSet.Id;
    Console.WriteLine(termSet.Name);
    Term term = termSet.Terms["Document subclassification"];
    TermCollection terms = termSet.Terms;
    Console.WriteLine(term.Name);//Looping through all webs of the input website
    SPWebCollection collWebsite = site.AllWebs;
    for (int i = 0; i < collWebsite.Count; i++)
    using (SPWeb oWebsite = collWebsite[i])
    //Looping through all lists in web
    SPListCollection collList = oWebsite.GetListsOfType(SPBaseType.DocumentLibrary); ;
    for (int j = 0; j < collList.Count; j++)
    SPList list = collList[j];//if the list name is Documents, create a new field of MMS type
    if (list.Title == "Documents")
    Console.WriteLine(list.Title);
    TaxonomyField field = list.Fields.CreateNewField("TaxonomyFieldType", SPLocationListColumn) as TaxonomyField;
    field.SspId = termSet.TermStore.Id;
    Console.WriteLine(termSet.TermStore.Id);
    field.TermSetId = termSet.Id;
    Console.WriteLine(termSet.Id);
    field.AnchorId = Guid.Empty;
    try
    {//Add the newly added MMS field to default view
    Console.WriteLine("Entering");
    Console.WriteLine("Entering");
    list.Fields.Add(field);
    Console.WriteLine("Entering");
    Console.WriteLine("Entering1");
    SPView view = list.DefaultView;
    Console.WriteLine("Entering2");
    list.Update();
    SPViewFieldCollection collViewFields = view.ViewFields;
    collViewFields.Add("CHECK6");
    Console.WriteLine("Entering3");
    view.Update();
    Console.WriteLine("Entering4");
    catch (Exception e1)
    Console.WriteLine(e1.Message);
    }//Capture a choice field by name subclass and move it to the newly added MMS field
    for (int f = 1; f < list.ItemCount; f++)
    if (list.Title == "Documents")
    Console.WriteLine(list.Title);
    SPListItem item = list.Items[f];
    if (item.Fields.ContainsField("subclass"))
    SPField field9 = item.Fields["subclass"];
    String subclassvalue = field9.GetFieldValueAsText(item["subclass"]);
    Console.WriteLine(subclassvalue);
    TaxonomyField taxonomyField = item.Fields["CHECK6"] as TaxonomyField;
    TaxonomyFieldValue taxonomyFieldValue = new TaxonomyFieldValue(taxonomyField);
    taxonomyFieldValue.TermGuid = term.Id.ToString();
    taxonomyFieldValue.Label = subclassvalue;
    taxonomyField.Update();
    item.Update();
    list.Update();

    From here:
    http://www.c-sharpcorner.com/uploadfile/anavijai/programmatically-set-value-to-the-taxonomy-field-in-sharepoint-2010/
    taxonomyFieldValue.TermGuid = term.Id.ToString();
    taxonomyFieldValue.Label = term.Name;
    SPListItem item = list.Items.Add();
    # item["Title"] ="Sample";
    item["TaxonomyField"] = taxonomyFieldValue;
    item.Update();
    list.Update();
    it appears you're missing the point where you assign that taxonomyFieldValue to the item's taxonomy field in question.

  • Get/retreive managed metadata column value from Document Library using SharePoint 2013 JSOM

    Hi,
    I am trying to retrieve managed metadata column (NewsCategory) value in SharePoint 2013 Document library using JSOM.
    I get "Object Object" rather than actual value.
    I tried:-
    var newsCat = item.get_item('NewsCategory');
    alert(newsCat) //Displays [Object Object]
    var newsCatLabel = newsCat.get_label();
    var newsCatId = newsCat.get_termGuid();
    But, I get the error "Object doesn't support property or method get_label()"
    I also tried :-
    var newsTags = item.get_item(' NewsCategory ');
    for (var i = 0; i < newsTags.get_count() ; i++) {
    var newsTag = newsTags.getItemAtIndex(i);
    var newsTagLabel = newsTag.get_label();
    var newsTagId = newsTag.get_termGuid();
    Even now I get the error "Object doesn't support property or method get_count()"
    I have included " NewsCategory " in the load request:- context.load(items, 'Include(File, NewsCategory)');
    Any idea what the issue is? Do I have to add any *.js file using $.getScript?
    I added following .js files
    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js", function () {
    $.getScript(scriptbase + "SP.js", function () {
    $.getScript(scriptbase + "SP.Core.js", function () {
    Thanks in Advance,

    Hi Patrick,
    I already added those references. I just pasted the parts of script snippet in my initial post. To avoid confusion I am pasting here complete script.
    2.1.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js", function () {
    $.getScript(scriptbase + "SP.js", function () {
    $.getScript(scriptbase + "SP.Core.js", function () {
    function getdata() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getByTitle('Documents');
    var camlQuery = new SP.CamlQuery();
    var filterCategory = 'Solutions';
    var IDfromTaxonomyHiddenList = 15;
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef LookupId="TRUE" Name="'+filterCategory+'" /><Value Type="ID">' + IDfromTaxonomyHiddenList +'</Value></Eq></Where></Query></View>');
    /*the above CAML query successfully gets all the list items matching the criteria including "NewsCategory" managed metadata column values
    But when I try to display the value it retrieved it ouputs/emits Object Object rather than actual values */
    var items = list.getItems(camlQuery);
    context.load(items, 'Include(File,NewsCategory)');
    context.executeQueryAsync(
    Function.createDelegate(this, function (sender, args) {
    if (items.get_count() > 0) {
    var listItemEnumerator = items.getEnumerator();
    while (listItemEnumerator.moveNext()) {
    var oListItem = listItemEnumerator.get_current();
    var file = oListItem.get_file();
    var name = file.get_name();
    var newsCat = oListItem.get_item('NewsCategory'); alert(newsTags.constructor.getName());
    alert(newsCat) //Displays [Object Object]
    var newsCatLabel = newsCat.get_label(); // Here it errors out with message "Object doesn't support property or method get_label()"
    var newsCatId = newsCat.get_termGuid();
    } //end while
    }//end if
    Function.createDelegate(this, function (sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(getdata, "SP.Core.js");
    </script>
    In the above script "var name = file.get_name(); " gets the exact file name.
    But the line "var newsCat = item.get_item('NewsCategory');
           alert(newsCat) //Displays [Object Object]  rather than actual value.
    Issue resolved replace "oListItem.get_item('NewsCategory');" with oListItem.get_item('NewsCategory').get_label();"
    Thanks

  • When to use Managed Metadata service in Sharepoint 2013 and 2010

    Hi Folks,
    I have been working on sharepoint from quiet some time now. I have been using managed metadata service also.
    What I have not been able to find out so far is when should I be using MMS.
    What are the real advantages that I can draw out of it.
    I have one application that has Managed Metadata installed and has various terms stores and terms. 
    The Managed metadata service  created is utilized in search,
    What I do not know is what is why are we using it at all. 
    What is benefit of it.
    Managed metadata service could also be used in navigation is what i know.
    But what confused me is when is the best scenario to use it for navigation.
    Why can we not use the navigation provider in the managed metadata service. 
    There might be other uses also, but that is not clear to me.
    Can any one tell me why and in which scenario to really use it.
    I know how to configure the mms and how it works though the jargons around the managed metadata.
    Regards

    Managed Metadata has some specific advantages that make it useful for certain situations.
    A managed metadata column has the following advantages over a lookup or choice column:
    A managed metadata term set can be shared across the entire SharePoint farm, so you can use it in different site collections.
    You can set up "synonyms" so that multiple similar terms resolve to the same underlying piece of information
    Terms can be hierarchical (terms can be nested under other terms), and the SharePoint interface allows hierarchical filtering. For example, if I have a term set for Location, and one of my terms is North America, with terms below that for United States,
    Mexico, and Canada, I could choose to filter my list to show me all records with any North America location (inclusive of US, Mexico, and Canada), or to filter on a specific term (such as Mexico).
    You can allow people to enter new terms, which will then appear in the term set.
    You can specify information owners/stakeholders who maintain the term sets without them needing elevated access to sites; normally only site owners can mess with site columns and content types. Managed metadata lets you separate information management
    (what terms/synonyms should be used) from site management (granting access, creating groups and lists, etc).
    There are some disadvantages too. For example, with a lookup column, the lookup list can store additional columns of information. A managed metadata term set (on the other hand) only really stores terms (and descriptions/synonyms), but not related
    info. You might be tempted to do something like create a term set for part numbers, representing every part that your company produces; the term set would handle the part numbers just fine, but wouldn't let you add extra columns of information for
    description, weight, price, etc. In such a case, a lookup list is the better option.
    Microsoft has some suggested guidelines for when to use managed metadata/term store:
    SharePoint 2013:
    http://technet.microsoft.com/en-us/library/ee519604(v=office.15).aspx
    SharePoint 2010:
    http://technet.microsoft.com/en-us/library/ee519604(v=office.14).aspx
    A brief summary...
    Managed metadata is a good option when the potential metadata meets the following criteria:
    ​Is something for which a user will select a valid value​
    Represents information that is likely to be used multiple times
    ​Has valid values that can be organized hierarchically
    ​Includes synonyms or abbreviations that should be aggregated
    ​Can be applied in one language, but might be viewed in other languages
    Managed metadata is not a good option if the potential metadata meets any of the following criteria:
    Is represented by a built-in column (such as “last modified date”)
    ​Has an infinite number of valid values
    ​Has different valid values in each location that it is used (such as different values for the “version” attribute depending on which product team’s site the item appears in)*
    ​Has only “yes” and “no” as valid values
    *This type of metadata could still be captured in site collection-specific term stores

  • Set Empty Managed Metadata Column - Working in 2010 and not in 2013

    I have seen posts similar to mine below but am still not finding a solution. I understand that setting an already populated managed metadata column can be problematic using SPD. However, my column is empty, and what works in 2010 is not working in 2013.
    Issue: In SharePoint 2010 On-premises, I am able to set an empty Managed Metadata column on a file in a document library via SPD workflow using the following format:
    ID;#Term|IdForTerm
    In SharePoint 2013 Online, I am attempting to create a SPD workflow to do the exact same thing (ID;#Term|IdForTerm) and am experiencing the following results depending upon the type of workflow I try:
    - SP 2010 Workflow - The workflow status result is Completed, but the managed metadata column remains empty.
    - SP 2013 Workflow - The workflow internal status becomes Started and effectively remains this way until I end the workflow.
    Any thoughts on what needs to change for 2013 when doing this? 
    Thanks in advance for any help or guidance.
    Alan

    Hi,
    I try to reproduce the issue in my SharePoint Online environment, however, everything works well.
    I create term set as below:
    Then start the workflow and the value in the browser view. The result is as below:
    I recommend to create another managed metadata column to check whether it works.
    Or you can create another library to check whether it works.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Import List Items with Managed Metadata Field from CSV File

    Hello,
    I try to import list items from a CSV File. Most of the fields are populating correctly except the Managed Metadata Field. I found multiple examples on how to set Managed Metadata Fields with Powersehll, but unfortunately I couldnt get it running.
    The CSV File holds values for the Metadata Column, this value should be checked against the Metadata in the Termstore. If this Term is existent, then it should set the fields value, if it is not existant then it should add the term from the CSV File to the
    Term Set in the Term Store. Can anybody give me a tip on how to do this? This is what I have, where Line 4 holds the Metadata:
    $Siteurl = "http://siteUrl"
    $Rootweb = New-Object Microsoft.Sharepoint.Spsite($Siteurl);
    $Webapp = $Rootweb.Webapplication
    $listName = "Catalogue"
    $listWeb = Get-SPWeb $Siteurl
    $list = $listWeb.Lists[$listName]
    $pfad1 = "c:\temp\Servers.csv"
    $content = import-csv -Delimiter ";" -Path $pfad1 
    foreach ($line in $content) {
    $newItem = $list.Items.Add()
    $newItem["Field 1"] = $line.1
    $newItem["Field 2"] = $line.2
    $newItem["Field 3"] = $line.3
    $newItem["Field 4"] = $line.4
    $newItem.Update()
    write-host $line.Title imported
    Thanks!!

    Hi Jimmie,
    From your description, when importing list from csv to SharePoint site, you would like to compare if Managed Metadata column exists in term store, and return yes value, if not, add it to term store.
    That might need script to achieve. You need to import list at first, then get value from term store, and compare with the list. Change the list field per comparison result, then add new value to term store.
    However, there might some workaround to meet your requirement. Not surly understand, so I find some references for you:
    If you would like to export Term Set to CSV from SharePoint 2013, then you could compare it:
    http://gallery.technet.microsoft.com/office/PowerShell-for-SharePoint-a838b5d0#content
    If you would like to query SharePoint 2013 Managed metadata term store using JavaScript:
    http://sharepoint.stackexchange.com/questions/60045/query-sp2013-managed-metadata-term-store
    http://stackoverflow.com/questions/13858962/getting-all-the-term-stores-in-sharepoint-2010-web-services-or-client-side-obje
    If you would like to synchronize, import or copy term store & managed metadata in SharePoint between environments:
    http://www.matthewjbailey.com/synchronize-import-or-copy-term-stores-managed-metadata-in-sharepoint/
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Managed Metadata selection not appearing in Editform.aspx and DisplayForm.aspx after Managed Metadata column added to library.

    Hi,
    I added two managed metadata columns into a document library, but they are not appearing when you try to upload, or edit the properties of a document.
    In the Managed Metadata service the metadata is 'Available for Tagging' , and I've also looked at the permissions in
    http://sitenameLists/TaxonomyHiddenList/AllItems.aspx
    As one blog suggested, but this already has read access granted to NT AUTHORITY\Authenticated Users (NT AUTHORITY\authenticated users)
    The Connection Permissions in Central Admin, in the Managed Metadata Service Application has Full Access to Term Store granted for the service account that the application pool (Identity) is running under for the web app the site collection
    is in. 
    I've also deleted the whole document library and started over again, but the metadata selectors just don't show up for anyone, even when tried with the farm account.
    Any ideas what to investigate next appreciated.
    Thanks,
    Jonathan

    Ok, I think I've worked it out.
    It's to do with Content Types, if you add your own custom content type, then delete the default Document content type on a document library, before you add additional Managed Metadata columns to the library, they don't appear in the form. Another
    one for the Sharepoint quirks list.

  • How to update managed metadata column for all file in document library using powershell

    Hi,
    How to update managed metadata column for all file in document library using powershell?
    Any help on it.
    Thanks & REgards
    Poomani Sankaran

    Hi TanPart,
    I have changed the code which you have give in order to get the files from SharePoint 2010 Foundation  Document Library.But i am getting below error in powershell.
    Property 'ListItemCollectionPosition' cannot be found on this object; make sure it exists and is settable.
    Could you tell me which is the issues in it?
    See the code below.
    $web = Get-SPWeb http://ntmoss2010:9090/Site
    $list = $web.Lists["DocLib"]
    $query = New-Object Microsoft.SharePoint.SPQuery
    $query.ViewAttributes = "Scope='Recursive'";
    $query.RowLimit = 2000
    $caml = '<Where><Contains><FieldRef Name="Title" /><Value Type="Text">Process Documents/Delivery</Value></Contains></Where>' +
            '<OrderBy Override="TRUE"><FieldRef Name="ID"/></OrderBy>'
    $query.Query = $caml
    do
        $listItems = $list.GetItems($query)
        $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
        foreach($item in $listItems)
            #Cast to SPListItem to avoid ambiguous overload error
            $spItem = [Microsoft.SharePoint.SPListItem]$item;
            Write-Host $spItem.Title       
    while ($spQuery.ListItemCollectionPosition -ne $null)
    Thanks & Regards
    Poomani Sankaran

  • Caml query using managed metadata column

    hi,
     I am having a console appln, where i want  to pass the one paramater in the form of siteCol1:subsite1:subsite2  where  siteCol1:subsite1:subsite2 is the path of subsite which is in MMS.
    Can i pass this string paramter to the splist which contains a taxonomy column   and match this paramter in the listitemcollection and fetch only those recordw which matches this crirteria.
    and it should fetch the values which matches in a splist. the caml query it expects contains the taxonomy -managed metadata column - , but i am stuck with
    SPList splistLIST = parenttWeb.Lists.TryGetList("LIST1");
                          if ((splistLIST.Items.Count > 0 && splistLIST!= null))
                              SPQuery   objnodeQuery = new SPQuery();
                              objnodeQuery.Query =
                                  string.Format(
           "<OrderBy>" +
              "<FieldRef Name='ID' />" +
           "</OrderBy>" +
           "<Where>" +
              "<Eq>" +
                 "<FieldRef Name='myTaxonomy' />" +
                 "<Value Type='Text'>{0}</Value>" +
              "</Eq>" +
           "</Where>", _mcurrentPathTermSet);
                              SPListItemCollection nodeItemCollection = splistLIST1.GetItems(objnodeQuery);
    am not able to retrieve the listitems which passes this as a parameter and retrieve those records where it matches this taxonomy column.
    my doubt is, how to pass a string parameter to the splist contains taxonomy column and fetch those records

    Hi,
    Managed metada column does not supported in lookup column as the thread below:
    https://social.technet.microsoft.com/Forums/en-US/0dee5ba4-9648-445f-a774-8c59cf01b81c/confirmation-needed-cant-lookup-managed-metadata-field-with-lookup-column?forum=sharepointgeneralprevious
    If you prefer managed metadata in Search, then I'd suggest you find workaround to use managed metadata column in lookup column. You could use a workflow to copy the managed metadata column to a text field, make the text field to be hidded from the list if
    necessary. Then lookup this text field in other list.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Not able to update multiple values in a managed metadata column.

    Hi ,
    I have an issue, where my user wants to add multiple values in managed metadata column. I tried to check out "allow multiple values option in list column settings, But it is throwing  an error "Cannot
    change this column to allow multiple values because it is currently being indexed."
    Could someone please help me , how to enable add multiple values option to the managed metadata list column.
    Thanks
    Badri

    HI Badri,
    Please manually remove the column from indexing.
    Refer the below article
    http://support.microsoft.com/kb/2015261/en-us

  • No values for refiners for managed properties based managed metadata columns in SharePoint 2013 on premise

    On a SharePoint Server 2013 setup (on premise) we want to use a number of managed metadata columns in the search as refiner. The managed metadata column is called "Document Language" and so it automatically creates a managed property called owstaxidDocumentx002Language
    which I can use to do a keyword query by typing owstaxiDocumentx0020Language:"NL" in the search box and it returns results. I also marked this managed property as refineable (in the service search application) and it appears in the
    seach refiners selection box but it states that there are no values for this refiner.
    So I decided to create a new managed search property "DocumentLanguage" and maps this to "ows_Document_x0020_Language" - I marked it as queryable, searchable, refineable, retrievable and sortable but this managed search property
    is not being filled up.
    I already executed a number of full crawls but this does not seem to work. Anyone know what to do next?
    Rgds,
    Joris [http://jopx.blogspot.com]

    It happened with me many times that the automatically generated managed property is not properly mapped to the crawled property and to get the correct crawled property  get the document item 
    $web=Get-SPWeb http://webUrl
    $list=$web.Lists["documentLibrary"]
    $list.Items[0].Xml>>item.xml
    View the item.xml and check if the ows_Document_x0020_Language contains data
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

Maybe you are looking for

  • How to populate the collaboration name field in B2B?

    hello, There a field in oracle B2B 11g console in Reports --> Conversations the Collaboration ID field get populated with the Id just wanted to know how can we populate the Collaboration name ? Regards, Shreya

  • Jpeg Images

    For some reason, my pdf files are not showing icons in their folders. Where there would usually be an icon, it is now blank. I can change to "preview icon" and see the actual jpeg document, however, I want the generic JPEG icon and do not want a prev

  • Error!!!! Please Help me

    Hi, Someone know how can I resolve or what means this problem....? com.sybase.jdbc2.jdbc.SybSQLException: escritorio not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).      at c

  • Product homepage for Java Desktop System?

    Where can I learn more about the product?

  • TDMS in 2-system landscape?

    Hi there, I'm going to start a new TDMS TDTIM project in a 2 system ERP landscape with only production and development system. My setup would be to use production also as central/control system and I would use a new client built as a SAP_UCUS copy of