Tuesday, November 22, 2016

AX 2012 - How to Add Linked Datasource using parent Datasource fields

Hi Guys

Can happen to add Datasource to a query using fields related to other parent Datasource.

In order to achieve this goal, the trick is use the third parameter of the AddLink Kernel Method of the QueryBuildDataSource class, like this:

qbdsXX = SysQuery::FindOrCreateDataSource(DataSource_ds.query(), tableNum(TableChild), tableNum(TableParent) );
qbdsXX.relations(false);
qbdsXX.joinMode(JoinMode::InnerJoin);
qbdsXX.fetchMode(QueryFetchMode::One2Many);
qbdsXX.addLink(fieldNum(TableParent, FieldA), fieldNum(TableChild, FieldA));
qbdsXX.addLink(fieldNum(TableParent, FieldB), fieldNum(TableChild, FieldB));
qbdsXX.addLink(fieldNum(TableParentParent, FieldC), fieldNum(TableChild, FieldC), DataSourceParent );


Stay tuned!

Sunday, October 2, 2016

Tree Control issue during adding Child node

Hi guys

A colleague reach me because a Form with a Tree control did not work as expected.

The Child node added at runtime do not appear on the Tree, also after the Expand method.

The trick is use the SysFormTreeControl Class, expandTree method.

More exactly, at the end of the init of the Form are been called the following methods:

SysFormTreeControl::expandTree(tree, tree.getRoot());
SysFormTreeControl::collapseTree(tree, tree.getRoot());

Finally, after every new child added at runtime, is been raised only the expandTree method.

Stay Tuned!

Sunday, August 28, 2016

Test Data Transfer Tool - Export only tables where the name start with

Hi Guys

At this link you can find useful details about to use the Test Data Transfer Tool.

I would like to share how to export only tables where the name start with specific characters.
In this case, as you know we have to use the regular expression.
Therefore, for instance, if we want to export ONLY the DMF tables the syntax will be:
.*(?<!^DMF.*)

Practically, create a new txt file, move the expression above and finally copy the file inside the Lists folder.

The example above is useful also to move the DMF Setup from one Environment to another.

Stay tuned!

Monday, July 4, 2016

TFS BUILD Start but nothing happen

Hi Guys

Sometimes happen that you run the Build Process, this one start, but does not happen nothing!

Also nothing is mention on Event Viewer.

After some investigation, I verified that the User that ran the Build is been different respect the Build Owner agent.

Also through Login on the TFS Build Server using the Build Owner Agent, the access to the TFS, etc. coming with other credentials.

I had the confirmation through the Credential Manager, opened from the Control Panel.

In order to fix the issue, I have:

1-      From the Credential Manager, Generic Credential, I removed all entries 

2-      I issue the follow command, “rundll32.exe keymgr.dll,KRShowKeyMgr” and removed everything related TFS


After that, reopen Visual Studio and all started again to work fine!

Enjoy with TFS!

Saturday, February 20, 2016

TFS – Export Changeset with relative WorkItem

Greetings!

Many of you use TFS in order to track the Development, Bug, Rework, etc. WorkItems.
Could be useful have a list of all Changesets with relative workitem, Owner, Estimation, Custom tag.
A really good script to achieve this result, is a PowerShell Script that you can find here

You can modify as per your needed, you can filter per Date, User, etc.
Take care in the Export to CSV file command, especially on the Group by “Group ServerItem”.
From my side, many Changesets had the “ServerItem” tag empty.

Enjoy with TFS!

TFS BUILD : The tools version "12.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0"..

Hi All

During the TFS Build you can face the error “The tools version "12.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0"

This error is triggered during the command SysTreeNodeVSProject::importProject(@filename) and so it’s related the C Sharp Projects.

In order to fix, there are two options:

1-      Install Visual Studio 2013

2-      Install MicrosoftBuild Tools 2013

All the best!

Thursday, December 31, 2015

AX 2012 - RunBaseBatch Multithreading

Hi All

In AX 2012 Microsoft introduced the new framework (Business Operation Framework service) in order to consume a Batch process especially in Multithread.

But, you can use also the "old" RunBaseBatch class.
About it, take a look to this very interesting POST.

In order to submit a "task" class you can use two methods :

1- "AddRuntimeTask" method.
Adds an instance of a dynamic BatchTask to the BatchHeader.  The BatchTask added exists for only the current run.  It gets copied into the history tables and deleted at the end of the run.  The second parameter, inheritFromTaskId, copies settings such as the batch group and child dependencies from the task specified.

2- "AddTask" method.
Adds an instance of a BatchTask to the BatchHeader.  The BatchTask represents a batch-enabled class that will be scheduled for execution as a task by the BatchHeader.

So, you have to use the first one method otherwise if the process is recursive also the previous child completed tasks will be moved in running state together with the new tasks.

Happy new year!!