• Skip to main content
  • Skip to primary sidebar
  • Home
  • About
  • Recommended Readings
    • 2022 Book Reading
    • 2023 Recommended Readings
    • Book Reading 2024
    • Book Reading 2025
  • Supply Chain Management Guide
  • PKM
  • Microsoft Excel
  • Microsoft Copilot in Office 365
  • Public Wiki Page

Ali Raza Zaidi

A practitioner’s musings on Dynamics 365 Finance and Operations

Dynamics AX 2012

Entity Relationship diagrams of Dynamics Ax 2012 Tables

November 4, 2013 by alirazazaidi

Today I found the link on Microsoft website, where they upload the Entity Relationship diagrams for dynamics Ax 2012 table.

Module Name

     

ERD Link

     

Module-Tables Link

     

Parent-to-Child Link

Accounts payable ERDs Module-Tables Foreign Keys
Accounts receivable ERDs Module-Tables Foreign Keys
Budgeting ERDs Module-Tables Foreign Keys
Cash and bank management ERDs Module-Tables Foreign Keys
Compliance and internal controls ERDs Module-Tables Foreign Keys
Fixed assets ERDs Module-Tables Foreign Keys
General ledger ERDs Module-Tables Foreign Keys
Human resources ERDs Module-Tables Foreign Keys
Inventory and warehouse management ERDs Module-Tables Foreign Keys
Procurement and sourcing ERDs Module-Tables Foreign Keys
Production control ERDs Module-Tables Foreign Keys
Project management and accounting ERDs Module-Tables Foreign Keys
Retail ERDs Module-Tables Foreign Keys
Sales and marketing ERDs Module-Tables Foreign Keys
Service management ERDs Module-Tables Foreign Keys
Travel and expense ERDs Module-Tables Foreign Keys

 

Further detail link is below.

 

http://www.microsoft.com/dynamics/ax/erd/ax2012r2/

Dynamics Ax 2012: Configuration of basic Setup or basic company data in Dynamics Ax 2012

November 4, 2013 by alirazazaidi

Recently I made a new Virtual machine for dynamics Ax 2012. The issue was the VM was clean, no legal entity and no step up data present in it. Purpose of making this virtual machine is to study functional side of dynamics Ax 2012. On Searching start up data, I found excellent article by MVP Murray Fife.

Murray Fife identity following steps for configuration of dynamics Ax 2012
Configuring the Legal Entity:
This is require for Legal entity, form which everything will operate. In my Case it will be Lahore 01 i.e. lh01 Legal entity.
Configuring a Business Unit:
For ledger it is a better to create a new business unit for Legal Entity.
Configuring Account Structures:
Account structure will be required to post new company ledger from within the organization.
Configuring Company Ledger:
After configuration of account structure, company ledger will link to this structure and define the Account codes.
Configuring Automatic Transaction Accounts:
There is requirement of auto transaction accounts at organization level.
Creating a Bank Account:
Last step is configuration of Default Bank Account.

The complete article by MVP Murray Fife.

Configuring a Basic Company in Dynamics AX

Microsoft dynamics ax 2012 development introduction part 2/3

October 26, 2013 by alirazazaidi

Microsoft dynamics ax 2012 development introduction part 2/3 from Ali Raza Zaidi

Microsoft dynamics ax 2012 development introduction part 1/3

October 20, 2013 by alirazazaidi

My Presentation on Dynamics AX 2012 Development Introduction.

Microsoft dynamics ax 2012 development introduction part 1/3 from Ali Raza Zaidi

Dynamics Ax 2012 : “Only integrated security is supported for AX queries.”

October 19, 2013 by alirazazaidi

Recently I update my dynamics Ax development Environment by restoring Database from Production Dynamics AX Db. After the restoring the database, when I run any  SSRS report form Dynamics Ax, it  starts to give error  “Only integrated security is supported for AX queries.”

The reporting Services are working perfectly other than Dynamics Ax reports.

One way to apply the Windows Integrated Security on required report. By following way

  • Open Reporting Services Configuration Manager ( All Programs > Microsoft SQL Server 2008/2012 > Configuration Tools > Reporting Services Configuration Manager)
  • Go to “Report Manager URL” Tab and click on URL
  • Typically, URL will be in the format http://<ServerName>:80/Reports
  • Select the  Report under Dynamics Ax Folder

postSSRSRepMgr

 

  • In the opened page, select Data Sources on the left pane.
  • And apply Windows integrated security and click Apply.

postSSRSDSprop

 

 

But I found that error on all SSRS reports for Dynamics Ax 2012. For this, best way to delete all reports and redeploy them.
Steps are as follows:

  • First step to delete all reports, by selecting Dynamics Ax folder in Report server and delete it, this will all reports inside the reporting reports.

postSSRSDelDynAx

 

  • Then go to Report servers form in Dynamics Ax 2012 and click on “create report folder” button to create the Folder Dynamics Ax again

postSSRSRepSerForm

 

 

  • Now you can open Powershell (Administrative Tools > Microsoft Dynamics Ax 2012 Management Shell). Make sure you run Powershell as Administrator.
  • Deploy all the reports with the help of command:
    Publish-AXReport -ReportName *
  • Wait for completing the report deployment after it all reports will run fine.

 

What makes a good Dynamics AX Project Manager?

October 1, 2013 by alirazazaidi

On Google search i found very beautiful png file belongs to cognitive group. It will really help for me and for others. It belongs to other, but i like to share it with reference of owner,WescJv

http://www.cognitive-group.com/blog/ax/what-makes-a-good-dynamics-ax-project-manager-with-infographic

Sending Email using X++ code Dynamics Ax 2012

September 22, 2013 by alirazazaidi

In Dynamics Ax 2012, there is form for configuration parameters. There parameters will further use in sending email. Following is the path of Step.

System Administrator è step upè Email parameters

Email Configuration Dynamics Ax 2012

 

These value stored in Dynamics ax 2012 table SysEmailParameters you can get these values by querying on this table using X++ code.

 

Consider following X++ job which read values form SysEmailParameters and send email using SysMailer api.

static void SendEmail(Args _args)
{
SysEmailParameters parameters = SysEmailParameters::find();
SMTPRelayServerName relayServer;
SMTPPortNumber portNumber;
SMTPUserName userName;
SMTPPassword password;
Str1260 subject,body;
InteropPermission interopPermission;
SysMailer mailer;
System.Exception e;

;
if (parameters.SMTPRelayServerName)
relayServer = parameters.SMTPRelayServerName;
else
relayServer = parameters.SMTPServerIPAddress;
portNumber = parameters.SMTPPortNumber;
userName = parameters.SMTPUserName;
password = SysEmailParameters::password();
subject = "Subject line for the email";
body = "<B>Body of the email</B>";

CodeAccessPermission::revertAssert();

try
{
interopPermission = new InteropPermission(InteropKind::ComInterop);
interopPermission.assert();
mailer = new SysMailer();
mailer.SMTPRelayServer(relayServer,portNumber,userName,password, parameters.NTLM);
//instantiate email
mailer.fromAddress("ax.notification@mycompany.com");

mailer.tos().appendAddress("alirazazaidi@live.com");
mailer.subject(subject);
mailer.htmlBody(body);
mailer.sendMail();
CodeAccessPermission::revertAssert();
info("Email has been send!");
}
catch (Exception::CLRError)

{
e = ClrInterop::getLastException();

while (e)

{
info(e.get_Message());

e = e.get_InnerException();
}
CodeAccessPermission::revertAssert();
//info(e);
info ("Failed to Send Email some Error occure");
}

}

 

Dynamics Ax 2012: Number of tables in Dynamics Ax 2012

September 11, 2013 by alirazazaidi

While working, the question aries in my mind, how many tables and view exists in default dynamics Ax 2012, with out any customization. I queried on Microsoft Dynamics AX database in Sql server

SELECT count(*)NumberOf,table_type FROM information_schema.tables group by table_Type

I found 3198 base tables and 477 Views.

Happy Dynamics Ax development.

Dynamics Ax 2012 : Exploring Data Base logging for Insert ,Update and Delete

July 1, 2013 by alirazazaidi

Dynamics Ax 2012 provide the functionality to log insert update and delete functionality on table as well as selected filed of a table. When tracking on any table in dynamics Ax, a new entry will be created in sysDatabaselog table.

Inside database logging required table will find with the help of label of function. For example if  we want to enable logging on table name Customer then we can find customer in table with label “Customer”. You can find the label of table by exploring the property of by selecting table.

Let’s we enable logging on our custom “Student” table.

For this purpose you have to go “System Administrator” Module of Dynamics Ax 2012. Under Step tab you will find database node, there you find “Database log” Click on it. Like this.

Log view

 

After that Database base logging Wizard will start

Studentselection

 

Press Next. On next page select “Not Specified” node of tree. All custom table/ user table will be placed under “Not Specified” Node. Dynamics Ax Default tables are placed under their respected module name.

Student

 

 

 

Expend the not specified node.  And select the student table there.

Student

 

 

Here you can track not only table but also possible you can track one or more fields of specific table. In current example we enable tracking or logging on whole student table.

 

 

 

Now question is how we can see what will comes in in sysdatabaselog table on insert update or delete on table.  You can view from this link

Node

 

 

 

All those table where “Save per company “ option enable, all log files will be stored in sysDatabaselog with respect to their legal entities where the insert update or delete occurs. All those tables where stored data gobally in “Dat” legal entities.  Logging records will be found in “Dat” company.

Now we explore the database structure of SysDatabaselog table. This will help us to get the logged information in X++ code.

Followings are some important fields of SysDatabaseLog table.

  1. Table:  This filed contains the integer value for each table. A unique integer number attached to each table in dynamics Ax. This fileds tells us on which table operation is performed.
  2.     Creation Date: This contains the date and time on which entry in sysDatabaseLog is created.
  3. Data:  X++ container type this contains the data.
  4. LoggType: This described insert, update or delete operation is pefromed at the result current entry is done in sysDatabaselog. It is of enum type. DatabaseLogType::Insert

 

 

For example, if database logging is enabled on our student table, we can track all insert, update or deleted record form database log table. For example if we have to pull all inserted today records form sysDatabaselog we can do by following way.

 Insert Case:

SysDataBaseLog sysDataBaseLog;

utcDateTime CurrentDate;

container tableRecord;

container recordInstance;

str selectedField;

str fieldName;

str fieldValue;

int idx;

int tableID;

str  databaseLogSourceCompany;

CurrentDate=DateTimeUtil::newDateTime(today(),str2time(“00:00:00”));

tableID = tableName2id(‘Student’);

 

while SELECT sysDataBaseLog

WHERE sysDataBaseLog.table ==  tableID && sysDataBaseLog.createdDateTime > CurrentDate && sysDataBaseLog.LogType == DatabaseLogType::Insert

{

selectedField = “RollNumber”;

fieldName=””;

fieldValue = “”;

tableRecord = (sysDataBaseLog.Data);

 

for( idx = 1; idx <= conLen(tableRecord); idx++)

{

recordInstance =  conpeek(tableRecord, idx);

fieldName = conpeek(recordInstance, 1);

 

fieldValue +=” ” + conpeek(recordInstance, 2) + ” , “;

break;

 

 

}

 

}

 

Update case will return three containers inside Data field of sysDataTable for each record, first one describe the field Name, second container returns the new value and third container will return old values. like

 

while SELECT sysDataBaseLog

WHERE sysDataBaseLog.table ==  tableID && sysDataBaseLog.createdDateTime > CurrentDate && sysDataBaseLog.LogType == DatabaseLogType::Update

{

selectedField = “RollNumber”;

fieldName=””;

fieldValue = “”;

tableRecord = (sysDataBaseLog.Data);

 

for( idx = 1; idx <= conLen(tableRecord); idx++)

{

// fields name in container.

recordInstance =  conpeek(tableRecord, idx);

fieldName = conpeek(recordInstance, 1);

 

// new values in container in same sequence as first container describe.

fieldValue +=” ” + conpeek(recordInstance, 2) + ” , “;

// Old set of value in same sequence.

fieldValue +=” ” + conpeek(recordInstance, 3) + ” , “;

}

Delete case:

Like Insert Delete case: you can find 2 containers first one contains fields name and second one contains the delete value in same sequence. But very important you can get recId of delete record as follow.

 

info(int642str(sysDataBaseLog.LogRecId)); complete code will be look like

 

 

 

while SELECT sysDataBaseLog

 

WHERE sysDataBaseLog.table ==  tableID && sysDataBaseLog.createdDateTime > CurrentDate && sysDataBaseLog.LogType == DatabaseLogType::Delete`

 

{

 

 

 

fieldName=””;

 

fieldValue = “”;

 

tableRecord = (sysDataBaseLog.Data);

info(int642str(sysDataBaseLog.RecId));

info(int642str(sysDataBaseLog.LogRecId));

 

 

 

for( idx = 1; idx <= conLen(tableRecord); idx++)

 

{

 

recordInstance =  conpeek(tableRecord, idx);

 

fieldName = conpeek(recordInstance, 1);

filevalue=conpeek(recordInstance, 2);

 

info (fieldName + ” Value : ” + fieldValue);

 

 

 

//}

 

 

 

}

 

 

 

 

 

 

 

 

Dynamics Ax 2012 : Number of months between two dates

June 11, 2013 by alirazazaidi

Recently I got small problem to calculate no of months between two dates. Dynamics Ax 2012 provides a default function which calculates no of intervals between two dates based on enumeration.

int intvNo(date input_date, date ref_date, int func)

You can use it as

noOfIntervals = intvNo(refDate, inputDate, intvScale::Month);

intvScale enumation have two values for months

  • Month
  • YearMonth

If we provide the intvScale::Month then X++ ignores the year and assumes that month is calculated within one year.

If we provide the intvScale::YearMonth then X++ calculate the number of months between different years. Consider following example.

static void NumberofMonthsbetweenTwodates(Args _args)

{

date inputDate = str2Date("1/1/2007", 213);

date refDate = str2Date("3/1/2009", 213);

int noOfMonths,noOfMonthsBetweenYears;

;

noOfMonths = intvNo(refDate, inputDate, intvScale::Month);

noOfMonthsBetweenYears = intvNo(refDate, inputDate, intvScale::YearMonth);

//  noOfMonths= intvNo(firstdate,seconddate,IntvScale::Month);

print("noOfMonths  :"+int2str(noOfMonths) + "  ,noOfMonthsBetweenYears  :"+int2str(noOfMonthsBetweenYears));

}

Info box will be return like

noOfMonths  :2  ,noOfMonthsBetweenYears  :26

Some cases above code did not works then used following function.

InfAdjValidation_MX::monthDifference(FromDate _fromDate, ToDate _toDate)

Example is as follow.

FromDate _fromDate = mkDate(1,1,2018);
ToDate _toDate =mkDate(31,1,2018);
info(int2str( InfAdjValidation_MX::monthDifference( fromDate, toDate)));

« Previous Page
Next Page »

Primary Sidebar

About

I am Dynamics AX/365 Finance and Operations consultant with years of implementation experience. I has helped several businesses implement and succeed with Dynamics AX/365 Finance and Operations. The goal of this website is to share insights, tips, and tricks to help end users and IT professionals.

Legal

Content published on this website are opinions, insights, tips, and tricks we have gained from years of Dynamics consulting and may not represent the opinions or views of any current or past employer. Any changes to an ERP system should be thoroughly tested before implementation.

Categories

  • Accounts Payable (2)
  • Advance Warehouse (2)
  • AI (3)
  • Asset Management (3)
  • Azure Functions (1)
  • Books (6)
  • Certification Guide (3)
  • ChatGPT (3)
  • Claude (1)
  • Customization Tips for D365 for Finance and Operations (63)
  • D365OF (60)
  • Data Management (1)
  • database restore (1)
  • Dynamics 365 (59)
  • Dynamics 365 for finance and operations (139)
  • Dynamics 365 for Operations (174)
  • Dynamics AX (AX 7) (134)
  • Dynamics AX 2012 (274)
  • Dynamics Ax 2012 Forms (13)
  • Dynamics Ax 2012 functional side (16)
  • Dynamics Ax 2012 Reporting SSRS Reports. (31)
  • Dynamics Ax 2012 Technical Side (52)
  • Dynamics Ax 7 (65)
  • Exam MB-330: Microsoft Dynamics 365 Supply Chain Management (7)
  • Excel Addin (1)
  • Favorites (12)
  • Financial Modules (6)
  • Functional (8)
  • General Journal (1)
  • Implementations (1)
  • Ledger (1)
  • Lifecycle Services (1)
  • Logseq (4)
  • Management Reporter (1)
  • Microsoft Excel (4)
  • MS Dynamics Ax 7 (64)
  • MVP summit (1)
  • MVP summit 2016 (1)
  • New Dynamics Ax (19)
  • Non Defined (9)
  • Note taking Apps (2)
  • Obsidian (4)
  • Personal Knowledge Management (3)
  • PKM (16)
  • Power Platform (6)
  • Procurement (5)
  • procurement and sourcing (6)
  • Product Information Management (4)
  • Product Management (6)
  • Production Control D365 for Finance and Operations (10)
  • Sale Order Process (10)
  • Sale Order Processing (10)
  • Sales and Distribution (5)
  • Soft Skill (1)
  • Supply Chain Management D365 F&O (5)
  • Tips and tricks (278)
  • Uncategorized (165)
  • Upgrade (1)
  • Web Cast (7)
  • White papers (4)
  • X++ (10)

Wiki

  • SCM

Copyright © 2026 · Magazine Pro On Genesis Framework · WordPress · Log in