I have got parent term's WSSID by this method. How do i get its child terms ids like this to build my CAML query for search in a share point list using CSOM

private static int GetWssIdByTermId(ClientContext clientContext, string termGuidString)

        int result = 0;
        Web web = clientContext.Site.RootWeb;
        List list = web.Lists.GetByTitle("TaxonomyHiddenList");
        var q = new CamlQuery()
            ViewXml =
               String.Format(@" <View>
                                 <FieldRef Name='IdForTerm' />
                                 <Value Type='Text'>{0}</Value>
        var items = list.GetItems(q);
        if (items.Count == 1)
            result = int.Parse(items[0]["ID"].ToString());
        return result;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.