≡ Menu

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.

 

{ 0 comments }

Dynamics Perf 2.0 important links

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

{ 0 comments }

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:

{ 0 comments }
1909892_791438587628609_5348240631126724162_n

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/


{ 0 comments }

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

{ 0 comments }

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

{ 0 comments }

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.

{ 0 comments }

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

{ 0 comments }

Exploring the Dynamic Ax (AX 7) workspace.

New Dynamics AX (AX 7) is web based. Its navigation layout is different than Dynamics Ax 2012.

Writing of this blog post, I am using Dynamics Ax 7 CTP8 beta version, so possible later version will have better navigation layout.

Lets explore what Current version offers us.

 

When we login into AX 7 web page. The first page or dashboard appears shows us multiple workspace. These workspace are depended on login user role.

 

Currently I am login with administrator user. So It will show all workspaces. Consider following screenshot.

Workspace.

 

 

Dashboards central area shows the multiple workspace links based on role of login user.

Workspace1

Left section contains a calendar, favorites and recently used pages. Calendar shows us current date. If click on any date, pop up message ask to change the session date.

Favorits and clander

On favorite tab, can be find all favorite page linked, which select as favorite, this feature helps user to go on specific page directly on which he most frequently works.

Next to it Recent, Here Dynamics Ax shows all forms you recently visited inside Dynamics Ax. It is some kind of history.

From right side or right section user can find all links to records which are assigned to him or her as result of workflow submission.

Assign to me

 

 

If we see top menu bar It will contains legal entry change, universal search and module menu. In below screenshot I attached different points to described in more detail.

navigation panePoint 1: If we click Dynamics Ax button, this will lead us on dashboard page or home page.

Point 2: Click on Icon pointed in 2. This will shows us pop up menu, which take us different modules and there respected forms.

2015-12-29_23-35-24

Point 3: AX provide excellent search button, for example in point 3 I entered the word “Product” , a drop down shows all possible links where word product found.

Search

Point 4: On point 4 is place where we can change legal entity

Legal entitiesPoint 5: Next item is on click we found link for task record and other option.

Menu2

 

Now we explore on other Sales order processing and Inquiry workspace. For this we have to click on top menu and open

Sales Inquery page

On clicking that we find following workspace page open

Workspace detail

The workspace is clearly divided into three parts.

  1. Summary one is summary section.

This section shows the summary of number of issues, status, count of particular status. For example above summary section shows that currently two unconfirmed sales order, Zero confirmed sales orders and 0 partially shipped in current legal entity. This summary also contains quick links for All Sales Orders and All customers.

Summary Sections

If I click on Unconfirmed summary button this will leads to list page where unconfirmed sales orders are placed.

Sumarry details

You can also see the action pane in above screenshot, This form open as result of clicking on Unconfirmed Sales Order summary button.

 

  1. Second section is tab section.

Tabbed Area

Tab are shows the list, steps and do list. For example if I click on unconfirmed tab than tabbed area looks the like following screen shot.

Tabbed Details

  1. Third section in workspace is links. Where you find links for other pages which related current paged. Here you find inquiries, frequently access page links etc.

Links

 

 

Multiple windows.

While working we usually open multiple screens, for this purpose Dynamics Ax 7 , provide a button on Action pane. Click on this button you can open multiple web pages.

Open in new window

 

 

 

 

Reports:

 We can also run reports from pop up menu. Lets run sales orders per customer.

Reports menu

By clicking on “Sales Order per customer” following tab open at right side of workspace.

Report Daliog

 

Expand Records to Include and add filter for report

Report Dalilog details

Click on filter under “Record to Include”

Customer DEtails

 

Click ok and customer is selected

Customer Selection details

 

Click ok to run report.

Loading and loading wait for loading report for selected Sales order.

Report load

Taa taan Reports opens.

Report is runned

 

 

{ 0 comments }

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.

{ 0 comments }