• Skip to main content
  • Skip to primary sidebar
  • Home
  • About
  • Recommended Readings
    • 2022 Book Reading
    • 2023 Recommended Readings
    • Book Reading 2024
    • Book Reading 2025
    • Book Reading 2026
  • 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

Tips and tricks

Dynamics Perf 2.0 important links

February 7, 2016 by alirazazaidi

I found following links for Dynamics Perf 2.0
http://blogs.msdn.com/b/axinthefield/archive/2015/12/18/what-s-new-in-dynamicsperf-2-0.aspx

http://blogs.msdn.com/b/axinthefield/archive/2016/01/03/dynamicsperf-2-0-scheduling-engine.aspx

http://blogs.msdn.com/b/axinthefield/archive/2016/01/06/dynamicsperf-2-0-is-here.aspx

http://blogs.msdn.com/b/axinthefield/archive/2015/12/30/dynamicsperf-2-0-deployment-guide.aspx

http://blogs.msdn.com/b/axinthefield/archive/2015/12/30/dynamicsperf-2-0-installation-for-dynamics-ax.aspx

How to get next recid in TSQL Dynamics Ax 2012

February 5, 2016 by alirazazaidi

Suppose we have to insert data into VendGroup table through TSQL, this scenario usually appear when integration or data migration team inject data into AX using TSQL without using AIF.

There are two tables are important SQLDICTONARY and SYSTEMSEQUENCES.

 

SQLDictonary table contains the table id for example Vendtable has 490 id.

SYSTEMSEQUENCES table contains the sequence number in nextVal field.

 

I used following code snippet which helps me to insert into AX through TSQL.

declare @tableId as int = (select tableid from SQLDICTIONARY where name like 'VendGroup' and FIELDID=0);
print @tableId;
declare @recId as bigint =(select nextval from SYSTEMSEQUENCES where TABID=@tableId and name='seqno');
print @recId;
select @recId set @recId =@recId + 1;
print @recId;
insert into DBO.VENDGROUP ([VENDGROUP],[NAME],[RECID],DATAAREAID,CREATEDBY,DEL_CREATEDTIME,CLEARINGPERIOD,PAYMTERMID,RECVERSION) values ('80','TSQLTest',@recId,'usmf','ALICIA',19372,'Net10','Net10',0 );
update SYSTEMSEQUENCES set NEXTVAL = @recId where TABID=@tableId and name='seqno';

ssss
reference:

Custom lookup in reference group Dynamics Ax 2012

January 30, 2016 by alirazazaidi

Here is little tip regarding look up.
A few days ago, I have to take join with employee with my custom table. if you check that The primary key of HCMWORKER IS RecId.
So I have to create worker relation based on primary key i.e recid.\

2016-01-30_10-34-25

But when I drop the foreign key on form Grid. It creates reference group. And surprising this create out of the box lookup with similar to same based on alternative key.
2016-01-30_10-35-02

Now there is query appears that we have to filter it the workers of certain cariteria. for example you can certain designation or not terminate. now I face question how to add custom lookup in Reference group. Now there is no lookup function and same time if exists it will not work.
After searching I found referenceLookup method at data source field instead of grid text field. So Overwrite the method and similar code snippet creates the similar to out of the box lookup. You can extend it according to need.

2016-01-30_10-36-29

 

public Common lookupReference(FormReferenceControl _formReferenceControl)
{

HcmWorker HcmWorker;
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;

SysReferenceTableLookup sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(HcmWorker), _formReferenceControl, true);
;
sysTableLookup.addLookupField(fieldNum(HcmWorker, PersonnelNumber));
sysTableLookup.addLookupField(fieldNum(HcmWorker, Person));

queryBuildDataSource = query.addDataSource(tableNum(HcmWorker));

return sysTableLookup.performFormLookup();

}

Reference I used for this post, They help me during doing day to day task
http://devexpp.blogspot.com/2013/06/dynamics-ax-custom-reference-group.html
https://dynamicsaxposed.wordpress.com/2011/11/04/sysreferencetablelookup-class-for-reference-group/


Inline variable declaration in New Dynamics Ax (aka ax 7).

January 27, 2016 by alirazazaidi

Now in Dynamics Ax 7, now developer can declare variable/object where they need it. Instead ax 2012, where variable  declaration is only possible in very beginning of method or function.

For ( int counter =0; counter < 10; counter++)

{

 

If ( counter >10)

{

Int value= counter+10;

}

Else

{

Real percentage = (counter  *20) /100;

}

}

That’s good: Its ease to developer to declare variable where he needs.

That’s bad : it will disorganize the code, Its look better as in Ax 2012 that variables will declare in separate section. It was better to search reference of class object or table buffer

Try catch and finally in new Dynamics Ax (aka AX7)

January 24, 2016 by alirazazaidi

Finally I found that in new Dynamics Ax finally statement introduce in exception handling statement.

try
{
}
catch
{
}
finally
{
}

It means, everything written in finally must be execute. For testing this functionality I just create a runnable class and written following code.

class HelloWorld

{

/// <summary>

/// Runs the class with the specified arguments.

/// </summary>

/// <param name = "_args">The specified arguments.</param>

public static void main(Args _args)

{

ColorDC dc = new ColorDC();

ColorSc Sc = new ColorSc();

 

try

{

dc.parmColorName("Red");

Sc.InsertColor(dc);

dc.parmColorName("Green");

Sc.InsertColor(dc);

} catch (Exception::Error)

{

info("error");

}

finally

{

info("finally");

}

 

 

}

 

}

 

When run the code.

I found Info box in browser as

2016-01-24_12-47-01

Lot ID not specified Error DMF import Dynamics Ax 2012 R2 Cu7

January 15, 2016 by alirazazaidi

Today I had to troubleshoot the Inventory journal DMF import, which previously working fine. But somehow it start to throw “Lot ID not specified. Import cancel. Hour of hours debugging reveals nothing. Finally I found some warnings in Database synchronize. These warnings described some index errors on DMF entity tables and need to drop and recreate them.

So I delete the DMFInventJournalEntity  table at SQL Server level and from AOT right click on table and click on synchronize. This recreate the require table at SQL server level.

Or ignore the old entity create a new entity and import data with that.

Runnable classes and table browser in Dynamics Ax (Dynamics AX 7).

January 2, 2016 by alirazazaidi

Purpose of This post to explore the runnable classes to test the logic, checking the traditional X++ (AX 2012) code and new table explorer in Dynamics Ax 7.  This post is based on Dynamics AX (Dynamics AX 7) CTP 8.

 

In new Dynamics Ax (Dynamics AX 7) there is no more AX Jobs.  For testing certain logic we have to use runnable classes.

 

Suppose we have to test the logic for some service, which has data contract and Service contract classes.

Right click inside solution explorer and add new object and select runnable class.

New Item

New Job

 

 

Add test logic as

class HelloWorld

{

/// <summary>

/// Runs the class with the specified arguments.

/// </summary>

/// <param name = “_args”>The specified arguments.</param>

public static void main(Args _args)

{

ColorDC dc = new ColorDC();

ColorSc Sc = new ColorSc();

dc.parmColorName(“Red”);

Sc.InsertColor(dc);

dc.parmColorName(“Green”);

Sc.InsertColor(dc);

 

 

}

 

}

 

Now expand the project properties and set my Hello world class a start up object

sss

 

To explore the debug feature I add a break point and press F5. With debug window a new diaglonsitic tool runs, which shows memory and space used by my code processing.

 

I just test the traditional X++ code, Its works the same way as it was in Morphix editor in tradition AX (2012).

public void InsertColor(ColorDC Colorobj)

 

{

 

MyColorTable _Color;

 

Name _Name;

 

 

 

_Name = Colorobj.parmColorName();

 

 

 

select * from _Color where _Color.ColorName== _Name;

 

 

 

if (_Color==null)

 

{

 

try

 

{

 

ttsBegin;

 

_Color.ColorName = _Name;

 

_Color.insert();

 

 

 

ttsCommit;

 

}

 

catch

 

{

 

ttsAbort;

 

}

 

 

 

}

 

}

 

 

Now right click on table and from properties popup menu click on table browser.

2016-01-02_21-43-18

 

The new table browser inside Visual studio show me the values just inserted during debugging of above mentioned code.

sss3333

How to enable country or regional functionality to every country or region in Dynamics Ax 2012

December 20, 2015 by alirazazaidi

During customization, the requirement for client is met by feature built for certain region ie. China and Brazil. Instead of develop that functionality we have to enable this functionality to available in other region too. For this we have to clear the  “CountryRegionCodes” property.

2015-12-20_20-53-04

 

If we remove this property from menu, menu item, extended data types, enums, tables and forms.

Then this functionality will be available in all legal entities of every region. And more importantly we have to debug the code to remove any country or region specific checks.

Running Dynamics Ax 7 CT8 Vm on Windows 8.1

December 17, 2015 by alirazazaidi

By writing of this post, I just download the AX7 CTP8 Vm and configure on my machine.

I successfully configure it on hyper V. Only one tricky point is external network adapter in Hyper V.

 

First step is download VHD and extract it to some place. If you are registered to AX 7 Feedback program, then you  must have vhd download link.

After the download, run the self-extract exe and extract the Vhd at specific location.

CTP8

 

2015-12-17_18-24-16

Step 2. Create a new external network adapter

Open hyper v console, and create new external network. As I am using wireless network, so I select it as bridge for using internet inside VM. You can use your Ethernet network as bridge.

 

2015-12-17_21-06-18

 

 

Step 3 Create a new Vm.

2015-12-17_21-01-54

Select generation 1 vm in next step

2015-12-17_21-04-01

2015-12-17_21-04-28

 

Set 8 GB ram to vm, recommend ram is 16 GB.

2015-12-17_21-04-56

Select network adapter we created in previous step.

2015-12-17_21-07-42

Select use existing hard drive and select the Vhd extracted in previous steps.

2015-12-17_21-08-33

 

Click on next and click on finished.

 

Run the VM and click on connect button. Login in with “Administrator” and Password is “pass@word1”

 

When VM is running you find new network connection ask your permission, Click on Yes button.

2015-12-17_21-15-34

 

Please check that network is working fine inside VM. Some times it will gives error “network has not assigned ip address”.  If external network adapter will not work then you have to create internal network and use that.

For this I create Internal network adapter in Hyper v. For currently I created a new internal adapter with name
“GateWayToInternet”.

internal

Now open the network and sharing center in windows. either using wifi or Ethernet. right click on it and from properties window select sharing tab.

Sharing

check the checked box for sharing internet and from drop down select the v Ethernet (which we create in one above step). stop the vm and use newly created internal network adapter in its network setting. When you start the vm. it will successfully access the internet and let you access ax 7 in browser.

For more detail for Internal networks setting please use following link, I used it for configuration.

http://wordsideasandthings.blogspot.com/2013/01/hyper-v-internal-virtual-network-and.html

 

 

 

Wait a few minutes and then open Internet Explorer and type following url

 

https://usnconeboxax1aos.cloud.onebox.dynamics.com

 

This will lead you at login page

2015-12-17_21-38-38

 

For login you need to use some office 365 account.  Currently I used my other account which i created for Microsoft Dynamics CRM trail. Possible if office 365 account did not work then register for CRM trail. 🙂

You may found “Provision tool” on the desktop of VM”.

2016-02-17_13-18-31

Right click on it and run it  as administrator.

enter your office 365 account  and click on submit.

2016-02-17_11-56-48

wait a few minutes. When  success message popup login with office 365 account.

2016-02-17_11-58-33

 

If your network Adapter is successfully configured, AX 7 welcome page will open, other wise you will find error page.

 

2015-12-17_21-42-56

 

 

 

 

 

 

 

 

 

Delete a legal entity in Dynamics Ax 2012

December 12, 2015 by alirazazaidi

Today I have to delete all legal entities from one of MS Dynamics Ax 2012 environment.

During this I got following error while deleting legal entities.

“Can not record , The corresponding AOS  validation failed”.

This error clearly shows that Transnational data exists in that legal entity.

I follow these steps to clear all legal entities.

  • First of open AOT with development rights.
  • Change the legal entity from DAT to required legal entity.
  • From AOT, expand the Class node, type SysdatabaseTransDelete. When find, right click on it click it open / run. It will delete all transactional history of required legal entity.
  • Now open the new workspace and open Organization Administrator ion => setup=>organization => legal entities.
  • Select on required legal entity and click on delete from top menu.

Some but on some legal entities delete button is still disabled. Because there is no important data as well I want to delete all legal entities, I manually delete the data in RCHYRELATIONSHIP table.

Otherwise I have to delete the organization hierarchy data carefully.

 

 

Following two links help me to solve this issue.

http://daxture.blogspot.com/2014/09/delete-legal-entities-in-ax-2012.html

https://community.dynamics.com/ax/f/33/t/139605

« 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 (64)
  • D365OF (60)
  • Data Management (1)
  • database restore (1)
  • Dynamics 365 (59)
  • Dynamics 365 for finance and operations (139)
  • Dynamics 365 for Operations (175)
  • 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