web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Active Discussion

The type 'System.String' for the query operator is not Queryable!

(0) ShareShare
ReportReport
Posted on by 417

Hi,

The below statement throws me below error

"The type 'System.String' for the query operator is not Queryable!" error at Microsoft.Dynamics.AX.Framework.Linq.Data.AXQueryFormatter.VisitMethodCall(..

var qryShipConfirmDate = context.UMAWHSOutboundShipmentHeaderEntity
.Where(x => x.AccountNum.StartsWith("27384"))
.OrderByDescending(o => o.ShipConfirmUTCDateTime)
.FirstOrDefault();

How to solve this?

I need Maximum date from ShipConfirmUTCDateTime column with condition AccountNum column contains 27384

Pls help.

Regards,
Manivannan

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Could you share any more details about your situation? What type of solution are you developing?

    This statement would give you the result that you need:

    select firstonly UMAWHSOutboundShipmentHeaderEntity

       order by ShipConfirmUTCDateTime desc

       where UMAWHSOutboundShipmentHeaderEntity.AccountNum == '27382';

  • vannamani77 Profile Picture
    417 on at

    It is Data Integration application developed in Visual studio 2015 with C# as code behind. I make API calls of D365FO entity through OData and do my business logic. UMAWHSOutboundShipmentHeaderEntity entity is a custom entity. What I am trying to do is I need Maximum date from ShipConfirmUTCDateTime column with condition AccountNum column contains 27384

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    Is that field a physical field in your entity data source,  or some field that you calculate when the entity is read?

    If it's not physical, then you can't filter or sort by it. Perhaps that would explain your problem?

  • vannamani77 Profile Picture
    417 on at

    It is a physical field. Both "ShipConfirmUTCDateTime" and "AccountNum" are refereed from WHSShipmentTable

  • Martin Dráb Profile Picture
    240,748 Most Valuable Professional on at

    Which of the statements causes the problem? For instance, will it work if you remove Where(x => x.AccountNum.StartsWith("27384"))? (This one looks the most suspicious to me.)

  • vannamani77 Profile Picture
    417 on at

    yes. you are correct. I replaced it with below statement and it worked.

    Where(x => x.AccountNum.Equals("27384*"))

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 426 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 358

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 353 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans