GROUP BY Cluse in GetDocuments

benyamin jain asked on August 12, 2015 18:27

HI

How it is possible to apply GROUP BY clause DocumentHelper.GetDocuments?

I want to Count Archived documents , in edit documents , published documents and ....

By using aggregated columns we can achieve this purpose but if any none aggregated columns required it must appear in Group BY. But there is no way to apply group by clause to DocumentHelper.GetDocuments method.

Recent Answers


Brenden Kehren answered on August 12, 2015 18:33

Check out the DataQuery article. It has GroupBy examples which should help you.

http://devnet.kentico.com/articles/kentico-8-technology-dataquery-api

2 votesVote for this answer Mark as a Correct answer

benyamin jain answered on August 13, 2015 10:45

HI Brenden

Thank you for reply but i forgot to say that i work with KCMS V 7.0.91

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 13, 2015 16:12

In v7, I do not believe there is. I'd create a custom query in your doc types Queries tab. Then dynamically call the query and pass your COLUMNS, WHERE, ORDER BY, etc. and ensure it has your GROUP BY statement in there. This way it still allows you to dynamically change your query if you want/need and still take advantage of the Kentico API.

0 votesVote for this answer Mark as a Correct answer

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