TaxonomyClientService.AddTerms(Guid, Guid, Int32, String) TaxonomyClientService.AddTerms(Guid, Guid, Int32, String) TaxonomyClientService.AddTerms(Guid, Guid, Int32, String) Method

Definition

Adds a new Term to the managed metadata TermStore object.

public:
 System::String ^ AddTerms(Guid sharedServiceId, Guid termSetId, int lcid, System::String ^ newTerms);
[System.Web.Services.WebMethod]
public string AddTerms (Guid sharedServiceId, Guid termSetId, int lcid, string newTerms);
Public Function AddTerms (sharedServiceId As Guid, termSetId As Guid, lcid As Integer, newTerms As String) As String
Parameters
sharedServiceId
Guid Guid Guid

TermStore Id of TermSet to add Term in.

termSetId
Guid Guid Guid
lcid
Int32 Int32 Int32

The language that the label will be added in.

newTerms
String String String

XML of new Terms to be added.

Returns

ID of the newly added Term.

Exceptions

Thrown if user does not have access to the root web of the current context.

Thrown if a TermStore with ID sharedServiceId does not exist. Also, thrown if you try to add a new Term under another Term (parentTermId is not the empty GUID), and you are trying to add to the keywords TermSet (TermSetId is the empty GUID).

Thrown if the TermSet with ID TermSetId does not exist.

Thrown if the parentTermId is not the empty GUID and the Term does not exist in the TermSet with ID TermSetId.

Remarks

New Terms must be stored in XML nodes named NewTerm with an attribute label, attribute clientId and attribute parentTermid. You can have as many NewTerm nodes as needed. clientId is an int that the client used to uniquely identify the newTerm. The parentTermId must either be the GUID of another Term, or an empty GUID if the new Term should be at the root of the TermSet.

Applies to