A Client Instance has a Repository. Within the Repository, there is aroot folder. You can query that root folder for an object to get the ID: ClientInstance.Repository.Root.FindTreeObjectRecursive("$/EJH_Test")

Then use the ID of the VaultClientTreeObject. Note,FindTreeObjectRecursive() results may be null, a VaultClientFile or aVaultClientFolder.

- bGetRecursive - flag to search for ALL of the labels applied to lowerobjects found in the repository path. Should most likely be false.

- bGetInherited - flag to indicate to retrieve labels that were applied toa parent. For example, if the query were to look up lables of$/A/B/C/D/E/F/ and this flag was set to true, it would find a 'parent'label applied at $/A/B/C/D/ (assuming D/E/F/ is a sub-folder of that label)

- nRowLimit - a ceiling for the number of labels to retrieve.

- nRowsRetrievedInherited - number of 'main' label items that could beretrieved.

- nRowsRetreivedRecursive - number of 'recursive' labels that could beretrieved.

- strQryToken - a token used to pass to the GetLabel*() methods andEndLabelQuery() to either retrieve label results and 'close' the queryonce the results are no longer needed.

// First get the id of the objectPath - why you need both id and name is a mystery but you do VaultClientTreeObject vctoObjectPathID = ServerOperations.client.ClientInstance.Repository.Root.FindTreeObjectRecursive("$/EJH_Test");

//Convert VaultClientTreeObject to long long iObjNum = Convert.ToInt32(vctoObjectPathID.ID.ToString()); Console.WriteLine(iObjNum);

//Count the number of labels returned Console.WriteLine(vltItems.Length); //Get the first member of the aultLabelItemX Array foreach (VaultLabelItemX vlixFirstItem in vltItems) { // Finally, write your label and label id to the console. Use the Read() function to force the console to stay open until you hit enter. Console.Write(vlixFirstItem.LabelID + ", "); Console.WriteLine(vlixFirstItem.Label); } Console.Read(); ServerOperations.client.ClientInstance.EndLabelQuery(labels); }

Last edited by ejhansen71 on Tue Dec 09, 2014 11:25 am, edited 1 time in total.

The above code gets just the labels under the main branch $/EJH_Test. Replace part of the code with this below to get all of the labels under $/EJH_Test recursively: //Take strQueryToken and load up your aultLabelItemX Array ServerOperations.client.ClientInstance.GetLabelQueryItems_Recursive(labels, 0, 100, out vltItems);

//Count the number of labels returned Console.WriteLine(vltItems.Length); //Get the first member of the aultLabelItemX Array foreach (VaultLabelItemX vlixFirstItem in vltItems) { // Finally, write your label and label id to the console. Use the Read() function to force the console to stay open until you hit enter. Console.Write(vlixFirstItem.LabelID + ", "); Console.WriteLine(vlixFirstItem.Label); } Console.Read(); ServerOperations.client.ClientInstance.EndLabelQuery(labels); }

In Vault 8 you will have a few additional options for working with labels. We have added the command FindLabels to our Vault command-line client and the function ServerOperation.ProcessCommandFindLabels() to the Vault 8 API.

In Vault 8 you will have a few additional options for working with labels. We have added the command FindLabels to our Vault command-line client and the function ServerOperation.ProcessCommandFindLabels() to the Vault 8 API.

Is there an examle C# code which uses the new ServerOperation.ProcessCommandFindLabels()?