none
The property can not be used for sorting or grouping results., Sort/GroupBy isn't supported for property IsRead. RRS feed

  • Question

  • Hello,

    I have a service written for fetching emails from outlook using EWS. This code was written 3 years back and has run without any issues.

    Today Morning all of a sudden there was this error:

    Microsoft.Exchange.WebServices.Data.ServiceResponseException: The mailbox database is temporarily unavailable., Cannot open mailbox.

    After that I started getting below error:

    Microsoft.Exchange.WebServices.Data.ServiceResponseException: The property can not be used for sorting or grouping results., Sort/GroupBy isn't supported for property IsRead.
       at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems(FolderId parentFolderId, SearchFilter searchFilter, ItemView view)

    Below is my code to fetch emails:

    below first line is throwing the error.

    FindItemsResults<Item> FindItemResults = service.FindItems(Customfolder.Id, new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false)), new ItemView(999));
                           
                            if (FindItemResults.Count() > 0)
                            {
                                service.LoadPropertiesForItems(FindItemResults, PropertySet.FirstClassProperties);

    Any help is appreciated.

    Thanks in advance.

    Wednesday, June 24, 2020 2:48 PM

All replies

  • Hi HelloWorld20,

    This is Exchange forum here and we discuss about on-premise Exchange issues, it seems your question is more about EWS, for such issues, I suggest to post your question in Exchange Development forum for better support.

    Thanks for your understanding.

    Regards, 

    Eric Yin


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Thursday, June 25, 2020 6:34 AM
  • Hi,

    I'm here to confirm with you if your issue has been resolved. If the problem is successfully solved, you can share your solution and mark them or the helpful reply as answer, this will make answer searching in the forum easier and be beneficial to other community members as well.

    Regards,

    Eric Yin


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Thursday, July 2, 2020 6:33 AM