Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Document Order View modes: 
User avatar
Certified Developer 11
Certified Developer 11
dfahy@ecentricarts.com - 11/15/2012 8:45:11 AM
   
Document Order
Hi,

I have a list of documents that I return using the DocumentHelper.GetDocuments method. In the doc type I have a field called Format that is stored as a Guid and points to a value in a custom table. This custom table contains a list of all Formats. I would like to order the documents but I can't use the Format field in the doc type as it is just a Guid. How can I order the documents by the ItemOrder field of the custom table?

Any help is appreciated

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 11/26/2012 6:40:04 AM
   
RE:Document Order
Hi,

The GetDocuments method is not suitable for this aim, as you need to JOIN the tables on the Format (GUID) column with your custom table. It might be possible to modify the default selectall query for your document type, however it cannot be recommended, because that query is used widely in other places and can be updated (refreshed) dynamically after any change in the document type definition.

You could create a custom query (DevGuide - Document type properties - Queries) and execute it via API as shown in Data layer custom query example article.
Hope this will help.

Should you need any additional details, please feel free to ask.

Regards,
Zdenek