Table Browser in Dynamics 365FO

Copy D365FO Table Browser URL

/?cmp=usmf&mi=SysTableBrowser&tablename=

URL:  https://usnconeboxax1aos.cloud.onebox.dynamics.com/?cmp=usmf&mi=SysTableBrowser&tablename=salestable

Syntax: D365foURL/?cmp=<Company>&mi=SysTableBrowser&tablename=<TableName>


I have created a form with menu to open the table browser( I have added a button in System Administration à Setup ) so a non developer can access it directly by clicking button for testing purpose)





[Form]
public class _TableBrowser extends FormRun
{
    [Control("String")]
    class TableName
    {
        /// lookup to list all the table names to pick
        public void lookup()
        {
            Query                                 query;
            QueryBuildDataSource    qbds;
            SysTableLookup                lookup;
            super();
 
            query = new Query();
            qbds = query.addDataSource(tableNum(SqlDictionary));
            lookup = SysTableLookup::newParameters(tableNum(SqlDictionary), this);
            qbds.clearRanges();
            qbds.addRange(fieldNum(SqlDictionary,fieldId )).value('0');
            lookup.addLookupfield(fieldNum(SqlDictionary, Name));
            lookup.addLookupfield(fieldNum(SqlDictionary, SqlName));
            lookup.parmQuery(query);
            lookup.performFormLookup();
        }
    }
 
    [Control("Button")]
    class TableBrowser
    {
        /// clicked method of button to fetch the table and its fields
        public void clicked()
        {          
            SysTableBrowser sysTableBrowser;           
 
            str tName;
 
            super();
           
            tName = TableName.valueStr();
           
            if (!tName)
            {
                throw error(strfmt("@ApplicationFoundation:SysTableBrowser_MissingTableName"));
            }
 
            sysTableBrowser = new SysTableBrowser();
            sysTableBrowser.parmTableName(tName);
            sysTableBrowser.run(tablename2id(tName));
        }
    }
}

Dynamics 365 Finance & Operations Development Tools in Visual Studio 2022 | Finance and Operations Extension | Dynamics 365 Extension Install | Microsoft.Dynamics.FinOps.ToolsVS2022.vsix | Microsoft.Dynamics.Framework.Tools.Installer.vsix

Issue: unfortunately FnO extension got corrupted/Removed so.

alternate way to install: we can update the Dev box to latest version can fix. but in some cases there is no latest version to update. dev is already updated version. or in my case i have the dev box with version 10.0.48 if I upgrade to 10.0.49 version it updates the dev box with visual studio 2026 which needs Dataverse credentials to install FnO Dynamic 365 extension. so my case it is not suitable. and another case my existing code have not compiled frontend not working so FnO batch services unable to start so update the VM from LCS may fail.

so here is the successful scenario to install extension.  


 if the Dynamics 365 extension Missed in Visual studio 2022. follow the procedure below mentioned.


Step1. If you have access to LCS, go to shared asset library (not inside the Project). 



Step 2:  goto software deployable packages. and download the Service update which is matched to your current VM(Dev box) version. (Mine is 10.0.48) 

It takes time to download because it is approx 6 GB size
once it is downloaded don't directly extract just open it and goto the path (DevToolsService\Scripts) there you can find file called Microsoft.Dynamics.Framework.Tools.Installer.17.xx.VSIX
Paste it into Devbox 

Note: before install Close Visual Studio 2022. 

Once it is installed successfully. open the visual studio and check the extensions menu.





Lookup code


[FormControlEventHandler(formControlStr(NewHireChecklistEmployeeDetails, Grid_PersonnelNumber), FormControlEventType::Lookup)]
public static void Grid_PersonnelNumber_OnLookup(FormControl sender, FormControlEventArgs e)
{  
    
Query                                query   =   new Query();
    
QueryBuildDataSource    qbds;
    
QueryBuildRange            qbr, qbr1;
    
SysTableLookup            sysTableLookup;
    
    qbds = query.addDataSource(
tableNum(HcmWorker));
               
    sysTableLookup  =   
SysTableLookup::newParameters(tableNum(HcmWorker), sender);
    sysTableLookup.addLookupField(
fieldNum(HcmWorker, PersonnelNumber));
    sysTableLookup.addLookupField(
fieldNum(HcmWorker, Person));
    qbr     =   qbds.addRange(
fieldNum(HcmWorker, NewHireChecklist));
    qbr1    =   qbds.addRange(
fieldNum(HcmWorker, NewHireChecklistAdded));
    qbr.value(queryValue(
NoYes::Yes));
    qbr1.value(queryValue(
NoYes::No));
    qbr.status(
RangeStatus::Locked);
    qbr1.status(
RangeStatus::Locked);
       
    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
 
    
//cancel the call to super() to prevent the system from trying to show
    //the lookup form twice and cause an error.
    FormControlCancelableSuperEventArgs cancelableSuperEventArgs = e as FormControlCancelableSuperEventArgs;
    cancelableSuperEventArgs.CancelSuperCall();
}

Email Validate

/// <summary>
/// This methos is used to validate the mail id.
/// </summary>
public boolean validateEmail(Email _emailId)
{
    System.Text.RegularExpressions.Match match;
    System.Boolean netBool;
    boolean xppBool;

 // str matchEmailPattern = *@"\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b";
    str matchEmailPattern = @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
                          + @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
                            [0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
                          + @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
                            [0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
                          + @"([\w-]+\.)+[a-zA-Z]{2,7})$";
    
    new InteropPermission(InteropKind::ClrInterop).assert();
    match = System.Text.RegularExpressions.Regex::Match(_emailId, matchEmailPattern);
    netBool = match.get_Success();
    xppBool = netBool;
    CodeAccessPermission::revertAssert();
 
    return xppBool;
}

DataEntity method calling sequence in Dynamics 365 F&O

 

CREATE(Insert) – method calling sequence

→ Entity.initValue()
→ Entity.validateWrite() → DataSource.validateWrite() → Table.validateWrite()
→ Table.insert()
→ Table.postInsert() → Entity.postInsert()

UPDATE – method calling sequence

→ Entity.validateWrite() → DataSource.validateWrite() → Table.validateWrite()
→ Table.update()
→ Table.postUpdate() → Entity.postUpdate()

DELETE – method calling sequence

→ Entity.validateDelete()
→ DataSource.validateDelete()
→ Table.validateDelete()

→ Table.delete()

→ Table.postDelete()


READ (GET) – method calling sequence

Reads are non-intrusive and do not call table insert/update logic.

Important methods involved

  1. Entity.mapEntityToDataSource()

  2. Entity.mapDataSourceToEntity()

  3. Computed columns

  4. View / Query execution

🚫 validateWrite, insert, update are NOT called for reads.


Where to write logic (best practices)

✔ Put logic in ENTITY when:

  • Integration-specific rules

  • Defaulting only for imports

  • Transformation logic

  • External system mapping

✔ Put logic in TABLE when:

  • Core business rules

  • Validations

  • Must apply to forms + services + entities

❌ Avoid:

  • Business logic only in entity

  • DB logic in entity

  • Heavy logic in postLoad()


Special hooks you should know

skipDataMethods(true)

  • Skips entity methods

  • Table logic still executes

Entity.enableStackedProcessing(true)

  • Improves bulk import performance

DataManagementImportExecution

  • Wraps everything during DMF import


Visual mental model (simple)

DMF / OData / Service ↓ Data Entity ↓ Entity Data Source ↓ Table ↓ Database

Reset Locked User of Dev Machine Box of LCS

 



Issue: 
Despite restarting the environment from both the Azure portal and LCS and resetting the password for the builtin\Admin user, we faced a persistent issue. Whenever we logged in using the builtin\Admin account, the problem remained.

Solution:
Here’s how we resolved it:

  1. Log in with an Alternate Account:
    • Open RDP using the builtin\User account.
  2. Run Command Prompt as Admin:
    • Open the Command Prompt with administrative privileges using the same(Admin user) credentials provided in LCS.
  3. Modify Local Computer Policy:
    • Run the following command to open the Local Group Policy Editor: gpedit.msc
  4. Navigate to:  Computer Configuration -> Windows Settings -> Security Settings -> Account Policies -> Account Lockout Policy.
    • Change the value of Account lockout threshold to 0.
    • Click Apply and OK.

  • In the Command Prompt, run: gpupdate /force

· Update Group Policy and Unlock Account:

  • In the Command Prompt, run: compmgmt.msc
  • Go to Local Users and Groups -> Users.
  • Find the builtin\Admin user, right-click, and select Properties.
  • Uncheck Account is locked out (if checked) and click OK.




Microsoft provided a package to Resolve the issue:  Download Account Lockout Status

Delete TFS Workspace Through command prompt D365 FO

Requirement: where I have situation need to configure the TFS in my Development machine but getting error when we map metadata.

 cause of the issue earlier in same Development machine another developer configures TFS with Private permission. so, system not allowing us to configure TFS.


Solution

1) Open Developer command prompt visualstudio2022 

2) Just enter tf workspaces will get the list of users and workspaces

            tf workspaces /owner:*



3) Deleting workspace name

Follow the syntax
tf workspace /delete "WORKSPACENAME;PREVIOUSUSERACCOUNT”


copy and paste in the command prompt and hit enter, then select "Y".

tf workspace /delete "Test_user_1;userxyz"  

after entering it will ask for confirmation enter yes. it will be deleted 


Data Migration from AX 2012 to Dynamics 365 Finance and Operations (D365FO)

 

Data Migration from AX 2012 to Dynamics 365 Finance and Operations (D365FO) is a critical process that requires careful planning, preparation, and execution. I’ll give you a step-by-step, detailed guide covering the full lifecycle.


Step 1: Planning & Analysis

  1. Understand Source and Target Systems
    • AX 2012 Version: CU/Hotfix applied.
    • D365FO environment: Target modules and legal entities.
  2. Identify Data to Migrate
    • Master Data: Customers, Vendors, Items, Chart of Accounts, Units, etc.
    • Transaction Data: Open balances, posted transactions, historical data.
    • Configuration Data: Dimension setups, parameters, financial periods.
  3. Define Migration Scope
    • Decide whether to migrate:
      • Only open balances (common in financial migration).
      • Historical data (if required for reporting or legal compliance).
  4. Identify Data Volume and Complexity
    • Check number of records, customizations, and integrations.
    • Identify any custom tables or fields in AX 2012.
  5. Create Data Migration Plan & Timeline
    • Include dependencies, sequencing, and downtime considerations.

Step 2: Data Cleansing & Preparation

  1. Clean Source Data
    • Remove duplicates, incorrect or incomplete records.
    • Standardize formats (like phone numbers, addresses, units of measure).
  2. Map Data Entities
    • Map AX 2012 tables to D365FO Data Entities.
    • Example: AX CustTable → D365 CustomersV3Entity.
  3. Define Field Mapping
    • Map AX fields to D365FO fields.
    • Handle renamed fields, new fields, or fields no longer used.
  4. Identify Transformation Rules
    • Currency conversions, date format changes, dimensions, unit conversions.

Step 3: Set Up D365FO Environment

  1. Create Legal Entities, Ledger, and Parameters
    • Configure chart of accounts, posting profiles, dimensions.
  2. Set Up Data Management Framework (DMF)
    • Go to Data Management workspace → Data Entities → ready for import.
    • Create Import/Export projects.
  3. Install LCS Tools if needed
    • Use Lifecycle Services (LCS) for environment setup and package deployment.

Step 4: Extract Data from AX 2012

  1. Use AX 2012 tools
    • SQL Server Export for large volume data.
    • Data import/export framework (DIXF) for standard entities.
  2. Export Master Data first
    • Customers, vendors, items, dimensions, chart of accounts.
  3. Export Open Transactions
    • Open AR, AP, Inventory, Fixed Assets, Bank balances.
  4. Format Data
    • Convert data into CSV, Excel, or XML suitable for D365FO Data Entities.

Step 5: Transform Data for D365FO

  1. Clean & Validate Extracted Data
    • Remove invalid references.
    • Ensure dimension combinations are valid in D365.
  2. Apply Transformation Rules
    • Example: Map AX Inventory status → D365 Inventory dimensions.
    • Convert currencies, UOMs, date formats as per D365FO standards.
  3. Prepare Data Packages
    • Split into multiple DMF packages if necessary (e.g., Customers, Vendors, Items, Balances).

Step 6: Import Data into D365FO

  1. Use Data Management Workspace
    • Go to Data Management → Import → Create Project
    • Add Entities: e.g., Customers, Vendors, Items.
    • Attach your data files.
  2. Validate Data Before Import
    • D365FO provides validate button to check errors before import.
  3. Import Master Data First
    • Sequence is crucial:
      1. Legal entities, charts of accounts
      2. Dimensions
      3. Customers & Vendors
      4. Items, Inventory dimensions
  4. Import Open Transactions
    • AR/AR balances, Inventory opening balances, Fixed assets, Bank balances.
  5. Check for Errors
    • Use Execution summary in DMF to fix errors.
    • Repeat import if required.

Step 7: Data Validation & Reconciliation

  1. Validate Master Data
    • Check key entities in D365FO vs AX 2012 (Customer IDs, Item IDs).
  2. Validate Balances
    • AR/AP balances, GL balances, Inventory quantities.
    • Perform trial reconciliations.
  3. Check Custom Fields & Entities
    • Ensure custom fields (if migrated) are populated correctly.
  4. Audit Logs
    • Maintain logs for regulatory and troubleshooting purposes.

Step 8: Cutover & Go-Live Preparation

  1. Freeze AX 2012
    • Stop posting transactions in AX 2012 before cutover.
  2. Final Migration Run
    • Repeat data extraction, transformation, and import for open balances.
  3. User Acceptance Testing (UAT)
    • End-users verify master data and transactions in D365FO.
  4. Go-Live
    • Switch production to D365FO.

Step 9: Post-Go-Live Activities

  1. Monitor Transactions
    • Ensure postings work correctly.
  2. Support Users
    • Handle any data discrepancies, missing references, or errors.
  3. Archive AX 2012 Data
    • Keep historical AX 2012 data in a read-only archive for compliance.

Step 10: Tools & Tips

  1. Tools to Use
    • Data Management Framework (DMF) – Main D365FO tool
    • SQL Server Management Studio (SSMS) – Extract large data sets
    • Lifecycle Services (LCS) – Manage project and environment
    • PowerShell scripts – Automate repetitive data import tasks
  2. Best Practices
    • Always start with a sandbox migration before production.
    • Migrate in logical order: Master → Opening Balances → Transactions.
    • Maintain detailed mapping documentation.
    • Automate repetitive validations using Excel or Power BI.

Table Browser in Dynamics 365FO

Copy D365FO Table Browser URL /?cmp=usmf&mi=SysTableBrowser&tablename= URL :  https://usnconeboxax1aos.cloud.onebox.dynamics.com...