SEARCH THE COMMUNITY

Find an existing answer

56 results for “d365fo”

CommunityHow do I see the SQL generated by an X++ select statement?I have an X++ select statement and want to see the actual SQL that D365FO generates behind it. Is there a way to get the generated SQL without actually running the query?CommunityHow do I add a button to an existing D365FO form?How do I add a button to an existing D365FO form?CommunityHow do I execute code when a form opens in D365FO?How do I execute code when a form opens in D365FO?CommunityHow do I get selected records from a D365FO grid?How do I get selected records from a D365FO grid?CommunityHow do I create a multi-select lookup in D365FO?How do I create a multi-select lookup in D365FO?CommunityAre RecIds unique across tables in D365FO?Are RecIds unique across tables in D365FO?CommunityHow do I create a runnable class in D365FO?How do I create a runnable class in D365FO?CommunityHow do I create an event handler in D365FO?How do I create an event handler in D365FO?CommunityHow do I create a batch job in D365FO using X++?How do I create a batch job in D365FO using X++?CommunityHow do I create a SysOperation service in D365FO?How do I create a SysOperation service in D365FO?CommunityHow do I debug a batch job in D365FO?How do I debug a batch job in D365FO?CommunityHow do I debug standard D365FO code?How do I debug standard D365FO code?CommunityHow do I find which method is creating or updating a record in D365FO?How do I find which method is creating or updating a record in D365FO?CommunityHow do I find where an Infolog error is coming from in D365FO?How do I find where an Infolog error is coming from in D365FO?CommunityHow do I use Trace Parser to debug D365FO?How do I use Trace Parser to debug D365FO?CommunityHow do I find references to a method, table, or field in D365FO?How do I find references to a method, table, or field in D365FO?CommunityD365FO X++: When to use `while select forUpdate` vs optimistic concurrency to avoid deadlocksIn Dynamics 365 Finance and Operations (X++), what are the correct patterns for updating rows that are first selected inside a `while select` loop using `forUpdate` (or `selectForUpdate`), and how can I avoid deadlocks/lock escalation when multiple transactions update the same reCommunityD365FO X++ optimistic concurrency: how to handle UpdateConflict using reread/orig() and decide between selectForUpdate vs retryIn D365FO X++, I’m seeing `UpdateConflict` exceptions in a high-concurrency workflow when updating the same record(s). I currently read the record with a normal `select`, store some fields from the buffer, and later call `update()`—but under concurrency it fails. What’s the recoCommunityD365FO: Choose validateField/validateWrite vs form control validation and wire errors to the UIIn Dynamics 365 Finance and Operations (X++), what’s the recommended approach to implement custom input validation for a form-backed entity: using table method overrides (`validateField` / `validateWrite`), versus validating directly in the form controls (e.g., `modified`/`validaCommunityD365FO: When `update_recordset` bypasses field validation/audit, should I use buffer `.update()`/`.doUpdate()` or an explicit loop?In D365FO, I’m doing a set-based change using `update_recordset` to update a few fields on `MyTable` for performance. However, this seems to bypass expected behavior: fields like `ModifiedField`/`ModifiedBy`, custom `validateField` logic, table/field events, and database logging/CommunityWhy Map/Set lookups fail in D365FO X++ when keys use EDT/enum or wrong types (how to normalize keys)In Dynamics 365 Finance & Operations X++ (particularly `Map`/`Set`), I’m seeing lookups return “not found” even when I believe the key values match. Example: a `Map` is declared as `Map tableKey`, where `tableKey` is an EDT or enum type (or sometimes the key is built from a `contCommunityD365FO form datasource extension: safe CoC for modified/active/executeQuery without recursionIn Dynamics 365 Finance and Operations (D365FO), I’m extending a form datasource using Chain of Command (CoC). I need to add logic around these methods on the datasource: - `modified()` - `active()` - `executeQuery()` (or a refresh method that ends up calling `executeQuery`) WhCommunityTroubleshoot D365FO Data Entity/OData field mapping errors (missing mappings, EDT/type mismatches) in X++In D365 Finance & Operations, I’m extending a Data Entity and consuming it via OData. The service sometimes fails with errors like “field mapping not found” or the payload is rejected (400) due to type/EDT mismatches. What’s the best way to debug the root cause when: 1) a Data ECommunityHow to trace the real X++ thrower in D365FO when stack is truncated (callstack()/xSession)?In D365FO X++ we’re handling an Infolog/error that originates deep inside nested framework calls. In release mode the debugger/stack sometimes only shows framework catch/rethrow frames, so the “throw site” is not obvious. Question: What’s the recommended way to use `callstack()`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 suspectCommunityD365FO X++ authorization: break-glass succeeds but normal user fails—how to trace privilege checks and securityKey/contextWe’re seeing a discrepancy in Dynamics 365 Finance & Operations where the same X++ logic succeeds when executed using break-glass/admin, but fails with “insufficient permissions” under the normal user. The code runs from multiple entry points (1) an interactive form method, (2) CommunityD365FO form datasource refresh/research: avoiding recursion and preserving modified field values in postRunIn D365FO, I’m extending a form via an override of `postRun()` and manipulating datasource fields. When the user changes values on an existing record, my overridden logic calls `ds.research()` / `ds.refresh()` to update UI controls and re-run calculations. However, I’m seeing twCommunityD365FO: Safe pattern for fetching/updating records across companies in X++ without using wrong execution contextIn D365 Finance & Operations (X++), what is a reliable pattern to **fetch and update records across legal entities** using `crossCompany`/`crossCompany::find` vs `changecompany`, while preventing accidental reads/writes to the wrong company or recursion/side effects? Context: - CommunityD365FO temp table: correct lifecycle for setTmpData/clearTmpData/deleteTmpData across method boundariesIn Dynamics 365 Finance and Operations, what are the correct usage patterns and lifecycle guarantees for `setTmpData()`, `clearTmpData()`, and `deleteTmpData()` when working with TempDB/in-memory temp table buffers? Specifically, I’m seeing temp records either unexpectedly persiCommunityHow 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 longCommunityD365FO Data Entities SCD: how to capture field-level details when `validateWrite`/`write` fails in X++ preprocessingIn D365FO Data Entities that use SCD (extended data entities / data entities with staging + SCD mapping to EDT-backed fields), `validateWrite` or `write` can fail with an error message that doesn’t clearly identify the source field or stack. What are the practical techniques toCommunityHow do I implement a custom comparer/hash for RecordSortedList/Set/Map when keys are EDTs or enums in D365FO X++?I'm building a lookup using `Map`/`Set` (and in one place `RecordSortedList`) in X++ where the key type in the collection is an EDT (or an enum EDT). However, equality/lookup behavior is inconsistent: sometimes `map.exists(key)` returns false even though I can find a record with CommunityHow can I limit selected fields in a form grid QueryBuildDataSource (NoFetch/fields list) to speed up executeQuery() in D365FO?I have a form with a grid datasource whose `executeQuery()` is taking too long. Profiling shows that the underlying `QueryRun` is fetching more columns than the grid actually displays (and there’s noticeable post-processing cost). How can I reduce over-fetching by limiting selecCommunityWhy does an X++ select forUpdate deadlock when I update a related table inside the same loop? (locking order)In an X++ job (non-SSRS), I run a `while select forUpdate` over `TableA` and, for each record, I update a related record in `TableB` inside the loop. Intermittently, concurrent runs deadlock in SQL. I suspect the lock acquisition order is inconsistent across sessions because theCommunityWhy doesn’t X++ form datasource `reread()` refresh the grid after updating the same record in a `tts` transaction (buffer/orig vs reread)?In a D365FO form extension I’m updating fields on a record that’s also the current cursor record of a form datasource. I then call the datasource `reread()` (or use a similar datasource refresh pattern), but the grid/control still shows the old/stale values. This happens especiaCommunityWhy does a form datasource extension update in Chain of Command `executeQuery()`/`active()` not change the grid results after the base query is rebuilt?I’m extending a form datasource in D365FO using Chain of Command and overriding/inserting into `executeQuery()` and/or `active()`. In those methods I add or modify a range on the datasource’s query (via the datasource’s `QueryBuildDataSource`). However, when the form loads or whArticleHow to Access the Table Browser in D365FOLearn how to open the Table Browser in Dynamics 365 Finance and Operations from Visual Studio or directly from the D365FO URL.ArticleHow to Create a Runnable Class (Job) in D365FOLearn how to create and execute a runnable class (job) in D365 Finance & Operations. This guide covers the main() method, running classes from Visual Studio and SysClassRunner, practical code examples, and common mistakes to avoid.ArticleD365FO Visual Studio Extension for X++ DevelopmentXppForge is a Visual Studio extension for D365FO developers that helps generate X++ classes, SysOperation frameworks, Chain of Command extensions, forms, security objects, and more.ArticleHow to Debug Standard D365FO Code and Find Which X++ Method Is RunningLearn how to find and debug the standard X++ code running behind D365FO processes using breakpoints, Find References, the Call Stack, table methods, and Trace Parser.ArticleHow D365FO batch job recurrence and alerts actually workA practical guide to setting up recurring batch jobs, understanding what recurrence really does, and using batch alerts so you know when a job finishes, fails, or gets canceled.ArticleHow to safely refresh a D365FO form datasource after you update data in X++A practical guide to the difference between refresh(), reread(), research(), and executeQuery() on form datasources, and how to choose the right one after an X++ update.ArticleD365FO Chain of Command: when to use class extensions vs event handlersA practical guide to choosing between Chain of Command and event handlers in Dynamics 365 Finance and Operations, with the tradeoffs that matter in real development work. It explains why extensibility points exist, where method wrapping fits, and how to avoid the common mistake of picking the wrong extension pattern.ArticleD365FO X++: Why `firstOnly` can still return the wrong row unless you make the ordering explicit`firstOnly` is a common shortcut in D365FO, but it does not by itself make the returned row deterministic. This article shows how to combine `firstOnly`, `order by`, and the right query shape so you get the record you actually meant to fetch.ArticleX++ update_recordset vs update() vs doUpdate(): when each one is safe in D365FOA practical guide to choosing the right D365FO update pattern. Learn when set-based updates are appropriate, when table logic still runs, and why doUpdate is usually the wrong escape hatch.ArticleHow D365FO alert batch jobs and recurrence actually workA practical guide to setting up batch jobs for alerts in D365 Finance & Operations, including recurrence choices, due-date vs change-based alerts, and the common setup mistakes that delay notifications.ArticleTroubleshoot D365FO invoice matching discrepancies in Accounts payableWhen vendor invoices don’t post the way users expect, invoice matching is often the reason. This article explains how D365FO invoice totals matching and three-way matching work, where to check the setup, and how to resolve the most common discrepancy scenarios without guessing.ArticleWhy `executeQuery()` wipes user filters on a D365FO form datasource`executeQuery()` is the right call when you changed a form datasource query in code, but it also rebuilds the datasource query run and can drop user-applied filters. If you only need to re-read data while preserving filters and sort order, `research()` is usually the safer choice.ArticleD365FO form datasource refresh(): when to use refresh, reread, research, and executeQueryIf a D365FO form shows stale data after an X++ update, the fix is usually not to call refresh() by itself. This article explains when to use refresh(), reread(), research(), and executeQuery(), why each one behaves differently, and the practical pattern that avoids empty grids, stale fields, and lost filters.ArticleWhy D365FO vendor invoices fail three-way matchingLearn what three-way matching actually checks in Dynamics 365 Finance, why vendor invoices fail on quantity or price, and which parameters you need to verify before the invoice can be posted.ArticleD365FO alert batch jobs and recurrence: why alerts are late, duplicated, or not sentIf change-based or due-date alerts in D365 Finance & Operations are delayed, duplicated, or never arrive, the usual cause is the alert batch job setup. Learn which batch job must run, how recurrence affects timing, and how to avoid common alert-processing mistakes.ArticleHow to see the SQL generated by an X++ query in D365FOWhen an X++ query returns unexpected rows, duplicates, or slow performance, the fastest way to debug it is to inspect the SQL that D365FO actually generates. This article shows the practical ways to print the query text and why the result is not always the same as the SQL you would write by hand.ArticleHow D365FO cash discounts work on vendor payments and settlementsUnderstand when Dynamics 365 Finance applies a vendor cash discount, how the settlement logic decides whether a payment qualifies, and which parameter controls the accounting entry. This article focuses on the practical cases that usually confuse AP teams: due date vs cash discount date, partial payments, overpayments, and where the discount posts.ArticleHow to extend a D365FO method with Chain of Command without breaking the call chainUse Chain of Command for wrappable public or protected methods, call next in the right place, and avoid the common mistakes that make an extension appear to work while actually bypassing base behavior. This article explains when CoC is valid, when it is not, and how to choose it over event handlers.ArticleHow to refresh a D365FO form after updating data in X++ without losing filtersWhen you update a record in X++ and the form still shows old values, the problem is usually not the database update itself — it’s choosing the wrong form datasource method. Learn when to use refresh(), reread(), research(), and executeQuery() so the grid updates correctly without wiping user filters.ArticleWhy a D365FO form filter disappears after `executeQuery()` in a datasource extensionIf you add or rebuild a form datasource query in X++ and the user’s filter suddenly disappears, the problem is usually that `executeQuery()` reran the datasource query instead of preserving the current search state. This article shows when that happens, why it happens, and how to keep user filters intact without breaking the form.