Skip to main content

Posts

Showing posts with the label AX 2012

The Dynamics Server could not be started because TCP Port 2712 is already in use AX 2012

Problem: We have faced an issue in production server in one of our client.There are three AOS server in NLB cluster. Server: AOS1,AOS2,AOS3 AOS1 is the primary AOS and other two are secondary.We have a practice  when we deploy any fixes in production server then we stop AOS2 and AOS3 service and restart AOS1 service to drain user session from the AOS. Last time we try to restart the AOS1 service  got error in event viewer  and other two AOS service worked properly. "The Dynamics Server could not be started because TCP Port 2712 is already in use AX 2012" We have found some commands in google to check the port availability in AOS1 server but after running those command result were same. Solution: We just restart the AOS1 server .It took one minute to restart the machine and reset all the configuration and assign default  2712  port to AOS1 and server were running successfully.

Difference between 2 utc datetime ax 2012 x++

Hi, In this post I am going to show the difference between 2  utc datetime and it will return the Days,Hours,Minute,Second in Microsoft Dynamics AX 2012.  utcDatetime PreparedOn ;  utcDatetime DispensedOn ;  str diffTime ;  int time; if(DispensedOn !=utcdatetimenull() && PreparedOn!=utcdatetimenull())  {      time           = DateTimeUtil :: getDifference(DispensedOn,PreparedOn);      diffTime    = strFmt('%1d:%2h:%3m:%4S',(time div 86400),((time Mod 86400) div 3600),((time Mod 3600) div 60),((time Mod 3600) Mod 60));   }

grid sort by descending order ax 2012 X++

You can add this code in the init method of the datasource : super() this.query().dataSourceTable(tableNum(InventTable)).addSortField(fieldNum(InventTable, RecId),SortOrder::Descending);

AX 2012 Table all fields and Label in lookup field

I have a requirement to pull all the field of Inventtable and store in table to show in Lookup field.First of all we will create a table ( TableFieldLookupTmp ) that will store all the fields detail of InventTable ? Lookup Code: public void lookup() {     SysTableLookup                SysTableLookup;     TableFieldLookupTmp    TableFieldLookupTmp ;     QueryBuildDataSource       queryBuildDataSource;     QueryBuildRange               queryBuildRange;     Query query                     = new Query();     tableName                        tableName = 'Inventtable';     int                                ...