Hello ax Newbie here.
An unhandled exception of type 'System.NotSupportedException' occurred in Microsoft.Dynamics.AX.Framework.Linq.Data.dll
I'm trying this simple Linq query, but im getting the above exception. Operands work just fine (like == or !=), but cant get this to work.
I assume the backend provider don't have Idea of how to translate the .Contains method, so if so, do you guys have an idea of how can I workaround this?
My piece of code in case the images won't load
static void Main(string[] args)
{
Session axSession = new Session();
axSession.Logon(null, null, null, null);
QueryProvider provider = new AXQueryProvider(null);
var purchases = new QueryCollection<PurchTable>(provider);
var purchasesQuery = from p in purchases
where p.PurchId.Contains("P453321")
select new { p.PurchId };
foreach (var purchase in purchasesQuery)
{
Console.WriteLine(purchase);
}
Console.Read();
axSession.Logoff();
}