4

Tridion 2011 SP1 HR2

I am having trouble getting multiple sort orders added via the .Net api.

We have multiple custom meta fields as below:

Order Items (Added in this order)

FieldName          FieldType            MetaDataType     Order

resource_category    Category             String         Asc
year                 Category             String         Asc
resource_material    Category             String         Asc

Query

using (var query = new Tridion.ContentDelivery.DynamicContent.Query.Query(criteriaBuilder.Criteria))
{
    if (orders != null)
    {
        foreach (var item in orders)
        {
            var sort = new CustomMetaKeyColumn(item.FieldName, item.MetaDataType);
            query.AddSorting(new SortParameter(sort, item.Ascending ? SortParameter.Ascending : SortParameter.Descending));
        }
    }
    var ids = query.ExecuteQuery();
    
    return ids;
}  

Example data:
Resource1 | A Category | 1941 | Report
Resource2 | B Category | 1981 | Report
Resource3 | A Category | 1984 | Document
Resource4 | B Category | 1980 | Report

Expected Result:
Resource1 | A Category | 1941 | Report
Resource3 | A Category | 1984 | Document
Resource4 | B Category | 1980 | Report
Resource2 | B Category | 1981 | Report

Actual Result:
Resource3 | A Category | 1984 | Document
Resource1 | A Category | 1941 | Report
Resource2 | B Category | 1981 | Report
Resource4 | B Category | 1980 | Report

In other words it only applies the last sort parameter applied.

There was mention in another post that this was a known issue See Here but that was July last year.

I am having issues trying to access the support system and can not find mention of this in the live docs etc so thought I would ask here.

Does anyone know if there has been an update to this or perhaps another way of implementing this via the api (trying to avoid dirtying custom code)

Thanks in advance

2

It was fixed in 2013; it has not been fixed for any version of 2011 as far as I know.

| improve this answer | |
  • Do you know if there is any plans to retro this back to 2011. We are not planning on moving to 2013 until next year. – dylman79 Oct 30 '13 at 9:04
  • I don't know of any plans, but that could just be because nobody has requested it (or it might not be a candidate for a hotfix). If you want it, you'll need to contact Customer Support and log a request; it will then be considered and you will get a definite answer (even if it's not to your liking :)) – Peter Kjaer Oct 30 '13 at 10:12
  • Thanks. I will mark this as the answer and update the post if I get any update on this through support. – dylman79 Oct 30 '13 at 10:19
  • Support has confirmed that this issue is fixed in 2013 and will not be retro'd back to 2011. – dylman79 Nov 6 '13 at 14:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.