Hi,
I am using the following code to query Purchase Orders from AX 2012 R2.
string time = "12/7/2008 08:32:51";
QueryCriteria qc = new QueryCriteria();
CriteriaElement ce = new CriteriaElement();
ce.DataSourceName = "PurchTable";
ce.FieldName = "modifiedDateTime";
ce.Operator = Operator.Equal;
ce.Value1 = time;
CriteriaElement[] cce = new CriteriaElement[1];
cce[0] = ce;
qc.CriteriaElement = cce;
PO = svcClient.find(callContext, qc);
but i am geting the error UTC date\time string is not in the expected format. have anyone tried this and can tell me the correct format?
i can fetch data using other fields but i want to use the modified date time field.
Please Help
Thanks
*This post is locked for comments
Very helpfull Martin,
I made at small adjustment to the format
yyyy-MM-ddTHH:mm:ss using Capital letters for month and for 24 Hour.
Thanks Martin
The right format is yyyy-mm-ddThh:mm:ss - you can get it easily by formatting a DateTime instance with "s" format, e.g. new DateTime(2008, 12, 7, 8, 32, 51).ToString("s");
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156