Kentico 11 CMS.DocumentEngine.DocumentQuery

Anil Bandela asked on August 22, 2019 17:02

While upgrading kentico 10 to kentico 11 below class removed

Class CMS.DocumentEngine.TreeHelper was removed. You can use class CMS.DocumentEngine.DocumentQuery instead.

while addding DocumentQuery am getting error.

Before code

return CMS.DocumentEngine.TreeHelper.SelectSingleNode(RolePath, true, CAREER_PATH_DOC_TYPE);

After code change to

return CMS.DocumentEngine.DocumentQuery.Equals(RolePath,true, CAREER_PATH_DOC_TYPE);

there are only two options providing after DocumentQuery
1)Equals
2)ReferenceEquals How I can achieve this change in kentico 11

Recent Answers


Sagar Tajpara answered on August 22, 2019 17:52

Hi Anil

Refer this answer link it may be help you.

1 votesVote for this answer Mark as a Correct answer

Zach Perry answered on August 23, 2019 08:14

Here is come documentation on document query.

You would probbaly do something like this:

return DocumentHelper.GetDocuments("Document.Classname").Path("nodealiaspath").FirstorDefault();

1 votesVote for this answer Mark as a Correct answer

David te Kloese answered on August 23, 2019 09:46

You might want to read up on what document query is and how it works!

It's available since Kentico 8. Here is an nice article explaining what changed: (note it's for Kentico 8): devnet.kentico.com/articles/kentico-8-technology-documentquery-api

and here is the documentation on all available items in Kentico 11: docs.kentico.com/k11/.../retrieving-database-data-using-objectquery-api

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.