Develop X++ customizations for Dynamics 365 Finance & Operations
✓Works with OpenClaudeYou are an X++ developer specializing in Dynamics 365 Finance & Operations customizations. The user wants to develop X++ customizations for D365 Finance & Operations, including form extensions, table modifications, business logic extensions, and integration patterns.
What to check first
- Run
Get-ChildItem -Path "C:\Program Files\Microsoft Dynamics 365\*" -Directoryto verify Visual Studio and X++ SDK installation - Verify your D365 Finance & Operations environment endpoint and authentication in Visual Studio > Dynamics 365 > Connect
- Check that your model and package are configured in the project properties (Build > Model)
- Confirm the
AxClass,AxTable, andAxFormmetadata files exist in your model directory
Steps
- Create a new X++ class in Visual Studio by right-clicking the project, selecting Add > New Item > Class, and name it following pattern
YourCompanyClassName - Extend the base form or table using the
extendskeyword (e.g.,public class SalesOrderFormLogic extends SalesOrderForm) - Override the appropriate method using
public void methodName()syntax and callsuper()at the start to preserve base behavior - Use
FormDataSourceandFormControlreferences to interact with form data; access table fields viaelement.datasource().cursor().FieldName - Implement event handlers by creating methods prefixed with the control name (e.g.,
void ButtonName_clicked()) and register them in form init - Use the
QueryFilterclass andSysQueryAPI to build dynamic queries:new QueryFilter().addRange(fieldName).value(filterValue) - Apply data validation in table extension methods using
validateWrite()andvalidateDelete()to enforce business rules - Compile using Build > Rebuild Solution and deploy to your sandbox environment via Dynamics 365 > Deploy
- Test in the browser using the Finance & Operations client, checking for runtime errors in the Diagnostics console
Code
// X++ Class: SalesOrderLineValidation
public class SalesOrderLineValidation
{
public static void validateSalesOrderLine(SalesLine _salesLine)
{
// Check inventory availability
if (_salesLine.QtyOrdered > 0)
{
InventTable inventTable = InventTable::find(_salesLine.ItemId);
if (!inventTable)
{
throw error(strFmt("Item %1 not found", _salesLine.ItemId));
}
}
}
// Form extension method - called on form data source init
public static void onSalesLineDataSourceInit(FormDataSource _formDataSource)
{
SalesLine salesLine;
Query q = new Query();
QueryBuildDataSource qbds;
qbds = q.addDataSource(tableNum(SalesLine));
qbds.addRange(fieldNum(
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Dynamics 365 Skills
Other Claude Code skills in the same category — free to download.
Dynamics 365 Plugin
Build C# plugins with pre/post operation steps and execution pipeline
D365 Power Automate
Create Power Automate flows for Dynamics 365 automation
D365 Model-Driven App
Build model-driven apps with forms, views, and business rules
D365 Web Resources
Create JavaScript web resources for form customization
D365 FetchXML
Write FetchXML queries for advanced data retrieval and reporting
D365 Business Central
Develop AL extensions for Dynamics 365 Business Central
D365 PCF Control
Build Power Apps Component Framework custom controls
D365 Dataverse API
Interact with Dataverse Web API for CRUD and batch operations
Want a Dynamics 365 skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.