Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Setting taxonomy field values

Hi,

very old discussion but answering mostley so I can find the answer myself next time I need it :-)

It looks like you can't update the specific Managed Metadata field directly, but the field has a corresponding hidden text field that shoud be updated instead. Below is my Managed Metadata field

<Field Type="TaxonomyFieldType" DisplayName="Agreement Type" List="{eb6ead69-5667-49ba-bae7-0f58cfd6aeb6}"
WebId="571eaa16-011c-46c8-9f50-ff9e62756d9b" ShowField="Term1033" Required="FALSE"
EnforceUniqueValues="FALSE" Group="Custom Columns" ID="{ba1d5078-44cc-4703-9a12-7d80166ccdbe}"
SourceID="{571eaa16-011c-46c8-9f50-ff9e62756d9b}" StaticName="Agreement_x0020_Type"
Name="Agreement_x0020_Type" Version="5" ColName="int3" RowOrdinal="0" Indexed="TRUE">

Based on this field ID, {ba1d5078-44cc-4703-9a12-7d80166ccdbe} the name of the hidden field is generated: ba1d507844cc47039a127d80166ccdbe

<Field Type="Note" DisplayName="Agreement Type_0" StaticName="ba1d507844cc47039a127d80166ccdbe"
Name="ba1d507844cc47039a127d80166ccdbe" ID="{4f95bfc5-db67-4b34-bbf9-cd1052f1dd82}"
ShowInViewForms="FALSE" Required="FALSE" Hidden="TRUE" CanToggleHidden="TRUE"
SourceID="{571eaa16-011c-46c8-9f50-ff9e62756d9b}" Customization="" ColName="ntext2"
RowOrdinal="0" />

Updating this field will lead to an update in the Manage Metadata field. The IdForTerm used is found in the [site url]/Lists/TaxonomyHiddenList/AllItems.aspx list described above. Example below

$().SPServices({
	operation: "UpdateListItems",
	batchCmd: "Update",
	listName: "Record Library",
	ID: 13,
	valuepairs: [["ba1d507844cc47039a127d80166ccdbe", 'Agreement type 1|dc3eb298-4f46-41ca-a662-e3a273b04cdf']],
	completefunc: function (xData, Status) {
		$("#tex").val(xData.responseText);
	}
});

/Fredrik


Viewing all articles
Browse latest Browse all 6517

Trending Articles



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