SEARCH THE COMMUNITY

Find an existing answer

3 results for “queries”

CommunityD365FO X++ select firstOnly with order by: how to guarantee deterministic row and verify generated SQLIn Dynamics 365 Finance and Operations, I’m using X++ statements like: ```x++ MyTable t; select firstOnly t from t where t.Status == Status::Open order by t.CreatedDateTime desc; ``` Sometimes users still report inconsistent rows between runs/environments. I suspectCommunityHow can I diagnose and fix slow D365FO form grid queries from QueryBuildDataSource (missing indexes, unbounded ranges, over-fetching fields)?In D365FO, I have a Form with a Grid bound to a data source whose underlying Query is built/modified in the `QueryBuildDataSource` (e.g., adding joins, `addRange`, `addLink`, and selecting fields). The grid is noticeably slow—CPU is fine, but SQL shows high logical reads and longToolX++ Code ExplainerExplain recognized transactions, queries, extensions, and database patterns locally.