Useful X++ code samples
This repository contains 3 D365FO models:
- XppTools
The DEV prefix is used for all objects.
It contains user X++ tools, with the additional application functionality. Each tool is located in the separate sub-model.
Fields list form is an extended version of the standard Show all fields form with the additional features such as displaying all fields with the extended information, comparing and editing
Full description: Fields list form. Sub-model name: DEVRecordInfo
This utility adds system field name in the standard query filter lookup and in the "Personalize-Add columns" dialog. So you can search the field by Label(as standard) or by AOT name
Full description: Filter by AOT name. Sub-model name: DEVQueryFieldsAOTName
This utility adds additional relation information into Add table join function of the standard Advanced query form(Advanced filter or sort - Joins - Add table join)
Code is based on sukhanchik post on axForum
Sub-model name: DEVSysQueryFormAddRelInfo
Extension for the standard D365FO table browser that allows root navigation and editing for non-development environments.
Test link https://usnconeboxax1aos.cloud.onebox.dynamics.com/?cmp=USMF&mi=DEVSysTableBrowser&tablename=custgroup. A user should be in the group "DEV Editable table browser"
Full description: Editable table browser. Sub-model name: DEVSysTableBrowser
This functionality is intended to help users deal with list of values in query range. With help of this tool you can:
- Copy list of values from, for example, excel and paste it in a range;
- Easily manage values of existed range
Full description: List of Values to Range Sub-model name: DEVListOfValuesToRange
'Execute direct SQL' is a simple form that allows to write and execute direct SQL from the browser on D365FO database.
Full description: Execute direct SQL in D365FO database Sub-model name: DEVSQLExecute
Elements that can be shared between different projects
-DEV class
Collection of global methods
DEVDimensionHelper class contains various methods to work with the financial dimensions.
Description: Working with the Financial dimensions
Classes: DEVFileReaderBase, DEVFileReaderCSV and DEVFileReaderExcel - read from CSV and XLSX files
Description: How to read Excel and CSV files in D365FO using X++
Various X++ examples, that can be used to test something or used as a template. Elements can reference to DEVCommon model objects
Form DEVBlockingTest, table DEVBlockingTestTable(to test SQL blocking issues)
Class DEVTutorialCreateLedgerJournal that demonstrates different methods for a ledger journal creation
Create ledger journals in D365FO using X++
Class DEVReadFromFileExampleCreateJournal - sample code to create a ledger journal from Excel file
Classes DEVTutorialBatchSingleThread, DEVTutorialBatchMultipleThreadBase, DEVTutorialBatchMultipleThread that demonstrates how you can convert your existing batch job to multi-threaded.
A simple way to implement a parallel batch processing in X++
Contains report development examples
A sample code to Create a new design for Sales Invoice report in D365FO (https://denistrunin.com/xpptools-reportsalesinvoice/)
Contains integration samples
A sample code for implementing file-based integration in Dynamics 365 FinOps using X++. Create Ledger journals based on periodic import of Excel/CSV files from Azure storage (https://denistrunin.com/xpptools-fileintegledger/). Test files for Demo database here
-
Download the Source code from this GitHub repo into the Temp directory on the DEV VM.
-
Copy DEVTools(or DEVGlobal, DEVTutorial) folder to your package folder (C:\AOSService\PackagesLocalDirectory )
-
Start Visual Studio and Run compile for the DEVTools folder (Dynamics 365 –Build models.. – Select DEVTools)
If you want to contribute - change the objects using Visual Studio in the DEVTools model, copy the changed elements(xml files) back into the Temp folder and create GitHub pull request from this Temp folder.
Feel free to create issues and PRs 😃