• 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

exception has been thrown by the target of an invocation Dynamics Ax 2012 R3

February 9, 2016 by alirazazaidi

A few days ago I face again the old error “Exception has been thrown by target of an invocation.

This time this error did not let us do anything on client.

2016-02-01_11-57-33

 

 

Finally I found that AOS server Configuration utility, database server is set as Server Name for example as “DB server” instead of  server IP. When sometimes Database server name is resolved by network configuration, AX working fine and some time when it unable to resolve the server IP with its name “Target of Invocation” error appears. On opening the AOS server configuration utility i found following error

Prod

 

When I click the ok button, AOS server configuration utility did not open, it shown in windows task management. So I kill its instance. Then Stop the AOS service form windows services management. Again open AOS server utility, it opened with in a few minutes (Still takes time). Then I create a new active configuration. And replace database server name with its IP. for example Instead of Database server name “DB server” I used the “192.168.1.1”. Save the settings and start the AOS service.  AX working fine and error disappears.

 

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/


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.

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.

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

Unable to preview the report, install the Business Intelligence Dynamics Ax 2012

December 6, 2015 by alirazazaidi

A few days ago, I had to modify reports in standard Dynamics Ax 2012 R3. Report successfully opened in Visual studio 2010, but when I tried to modify the report design, visual studio throw following error.

Unable to preview the report, install the Business Intelligence. Development Studio feature.

2015-11-29_9-59-09

For this I had to install the Business Intelligence Development Studio from SQL Sever 2008 R2 setup.

2015-11-29_17-14-13

After Installment this error resolved.

Reference: http://msdynamicsaxtips.blogspot.com/2015/02/unable-to-preview-report-install.html

 

How to handle empty pages in SSRS report dynamics Ax 2012

November 30, 2015 by alirazazaidi

Today I was facing the report issue that it print three blank pages other than one require page. This issue is due to page body is covering more area then print page size. During development phase we test the print page size by saving the report review as pdf. Followings is the tip which helps me to remove empty white pages from report print.

Check that page size and set it also set the you want print in portrait or landscape.

For example if I have to run the report on A4 and portrait form. Then I will perform following steps to set the print page setting and size of report page.

Right click on gray area of report and click on report properties.

2015-11-30_22-44-15

 

And set the report print and size and also set left and right margins

Page Size

 

 

 

Now note the page size is 8.27. We have to check report body size and it must be less than 8.27 inch. For this right click on White area in report canvas and press f4.

Body Size detail

 

 

From property window you can check it body size. If it larger then 8.27 in, then you must reset the table, tablix and matrix to and resize the body to less then 8.27.

resize

 

 

Now check rerun the report and save its preview in pdf.

 

 

Invent Journal and its relation with Voucher sequence number Dynamics Ax 2012 R3

November 18, 2015 by alirazazaidi

 

X++ code for these Invent transfer and movement journal is available in different blogs and website. The voucher number for these entries is little bit tricky. This Voucher Number is set InventJournalName as fellow screen.

xyz

By writing this simple tip I used out of demo vm with contoso data.

So If expand the InventJounralName table we will find this voucher sequence number set in VoucherSequenceNumberTable field.

VoucherSequenceNumber

If we expand the Relation node of InventJournalName table we find its relationship with Sequence Number table based on RecId.

ReleationShip

For getting next voucher Number for Journal lines we have to use static method of NumberSeq  as

 

 

InventJournalName   inventJournalName;

NumberSeq     _sequence;

num _voucher;

select firstOnly inventJournalName

where inventJournalName.JournalType == InventJournalType::Any

ttsBegin;

_sequence=   NumberSeq::newGetNumFromId(   inventJournalName.VoucherNumberSequenceTable);

_voucher=_sequence.num();

ttsCommit;

« 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