Trinh's AX Technical Blog
Tuesday, December 1, 2026
Thursday, November 26, 2026
Commerce Data Exchange (CDX) Seed Data Extension - transfer new fields or tables from HQ to POS
The two pieces
| Piece | Type | What it does |
|---|---|---|
ContosoRetail | Resource (XML file) | Says what to send, where it goes in the channel database, and which job sends it |
ContosoRetailCDXSeedDataEventHandler | Class | Adds your XML file to the standard list so the system reads it |
The resource is the list of what to sync. The class adds that list to Microsoft's standard one.
Step by step
Step 1: The resource describes the sync. It has two subjobs. A subjob is one table copied as part of a distribution job.
<RetailCdxSeedData ChannelDBMajorVersion="7" ChannelDBSchema="ext" Name="AX7">
<Subjob Id="ContosoSerialNumberPattern" ← subjob name in the Commerce scheduler
AxTableName="ContosoSerialNumberPattern" ← source table in HQ
TargetTableSchema="ext" ← custom tables always go to the ext schema
TargetTableName="ContosoSERIALNUMBERPATTERN"> ← target table in the channel database
<ScheduledByJob>1070</ScheduledByJob> ← sent when job 1070 (channel configuration) runs
<AxFields> PatternId, Pattern, RecId </AxFields> ← only these columns are copied- Subjob 1 (Contoso
SerialNumberPattern) copies the whole pattern table (ID, description, pattern) toext.ContosoSERIALNUMBERPATTERNwith job 1070. Job 1070 already sends channel configuration, so new patterns reach the stores with it. - Subjob 2 (Contoso
RetailParameters) copies the standardRetailParameterstable. It only takesKey,DataAreaId, the new ContosoSerialValidationAttributefield andRecId, and writes them toext.ContosoRETAILPARAMETERSwith job 1110. This is how the store knows which product attribute is the "Validate attribute".
Step 2: The event handler registers the resource.
public class ContosoRetailCDXSeedDataAX7EventHandler
{
/// <param name="originalCDXSeedDataResource"></param>
/// <param name="resources"></param>
[SubscribesTo(classStr(RetailCDXSeedDataBase), delegateStr(RetailCDXSeedDataBase, registerCDXSeedDataExtension))]
public static void RetailCDXSeedDataBase_registerCDXSeedDataExtension(str originalCDXSeedDataResource, List resources)
{
if (originalCDXSeedDataResource == resourceStr(RetailCDXSeedDataAX7))
{
resources.addEnd(resourceStr(ContosoRetailCDXSeedDataAX7));
}
}
}- While it builds the scheduler setup, the standard class
RetailCDXSeedDataBaseraises the delegateregisterCDXSeedDataExtension. A delegate is an extension point that other code can subscribe to. _originalCDXSeedDataResourcenames the standard seed data being processed. Theifmakes sure your file is added only to the current one (RetailCDXSeedDataAX7), and only once._resources.addEnd(...)adds your XML to the list. The system then merges it with Microsoft's standard definitions.
Step 3: Initialization creates the scheduler setup. Writing the code alone does nothing. After you deploy, go to Retail and Commerce > Headquarters setup > Parameters > Commerce shared parameters (or Commerce parameters) and run Initialize, or run Configure Commerce scheduler. This step:
- Reads the standard seed data and raises the delegate. Your handler adds your resource at this point.
- Creates the subjobs Contoso
SerialNumberPatternand ContosoRetailParameterswith their field mappings. - Links them to distribution jobs 1070 and 1110.
You can check the result under Commerce scheduler > Scheduler subjobs.
Step 4: The distribution job copies the data. When job 1070 runs (on its batch schedule, or with Distribution schedule > 1070 > Run now), CDX:
- Reads Contoso
SerialNumberPatternin HQ. - Packages the rows into a download session.
- Writes them into
ext.ContosoSERIALNUMBERPATTERNin the channel database.
Job 1110 does the same for the parameter.
Step 5: The store reads the data. Your CRT trigger reads the patterns and the parameter from the ext tables locally. It doesn't call HQ at runtime, so validation also works offline if the offline database is in sync.
Things that commonly break this
- The target table must already exist. The
ext.ContosoSERIALNUMBERPATTERNandext.ContosoRETAILPARAMETERStables come from the SQL script in the channel database project. If they're missing, the download session fails with status "Failed" or "Error". - Column names must match exactly. The SQL columns must be
PATTERNID,DESCRIPTION,PATTERNandRECID, matching the field names in the resource. RecIdis required. CDX uses it as the key to update or replace rows.- For the parameters,
KeyandDataAreaIdare needed.RetailParametershas one row per legal entity. The store finds its own company's row byDataAreaId. - Run Initialize again after every change to the resource XML. Otherwise the scheduler keeps the old definition.
Friday, November 20, 2026
Map Git Repository in D365 FO development environment
These are steps that you need to set up before developing your first D365 FO project:
1. Clone the Git Repository, exp: in drive C in your pc.
2. Link the cloned models with the models under the PackagesLocalDirectory: open cmd and run the below command:
mklink /D K:\AosService\PackagesLocalDirectory<ModelName> C:\Users\aaa\Documents\src\xplusplus\models<ModelName>
3. Open VS and build custom models with Sync DB option
Now you can create your project under the project folder in the cloned repository (ex: C:\D365\src\xpp\projects) and it will be mapped to the PackagesLocalDirectory.
Thursday, March 13, 2025
Import an ISV licese file into Dev environment using Power Shell
K:\AOSService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --setupmode importlicensefile --metadatadir K:\aosservice\PackagesLocalDirectory --bindir K:\aosservice\PackagesLocalDirectory --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd *** --licensefilename "C:\Temp\A.txt"
Wednesday, March 12, 2025
Apply an ISV package on a Dev environment
1. Upload the compressed package to LCS > Asset Library > Software deployable package
2. Go to Dev environment > Maintain > Apply updates > select the package
Monday, July 8, 2024
Debug in a Tier-2 (UAT) environment
From time to time, you may have to debug a copy of the production database, but you are unable to export & import the DB to your dev machine, for example: the DB's size is too large, or it's an urgent issue, or the customer doesn't allow to export their Prod DB... Then you have to debug directly in the UAT environment.
There is an article from Microsoft that describes briefly about this here, but there is no screenshot and the information isn't detailed enough, so the purpose of this post is to guide you step by step to achive this :)
1. Find your ip address at https://nordvpn.com/what-is-my-ip/ and note it down
2. Enable just-in-time database access
Go to LCS > Select the Tier 2 environment > Maintain > Enable access
Thursday, November 23, 2023
Set up Onebox VM for D365 FO with non-organization microsoft account
With the release of the new VHD 10.0.37, I have tried to create a Onebox VM in my laptop instead of using the cloud hosted environment and found the below articles really helpful to setup the VM with my private Microsoft account:
https://alexdmeyer.com/2023/07/05/step-by-step-guide-to-deploy-a-local-vhd-of-d365fo/
https://community.dynamics.com/forums/thread/details/?threadid=01455e69-5d7e-4896-b2c6-673a49b28bfa
-
From time to time, you may have to debug a copy of the production database, but you are unable to export & import the DB to your dev ma...
-
1. Upload the compressed package to LCS > Asset Library > Software deployable package 2. Go to Dev environment > Maintain > Ap...
-
If you faced this error when you tried to run any of the standard reports in D365FO, it's better to re-install the reporting extension i...









