nbtstat commands for windows.

Hi, MS-DOS utility that displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP), which allow the user to troubleshoot NetBIOS name resolution issues. Normally, name resolution is done when NetBIOS over TCP/IP is functioning correctly. It does this through local cache lookup, WINS or DNS server query or through LMHOSTS or Hosts […]

Code / Job to run any application from AX

Hi,     static void AlfasithRunAnyApplication(Args _args)     {         WinAPI::shellExecute(“D:\Dynamic Netsoft Construction Suite V2.pptx”);         WinAPI::shellExecute(“C:\Users\dns.amohamed\Downloads\Love Mash Up.mp3”);         // Here Application will wait till previous application opens / runs     } Regards,

Code to refresh AOS and remove *.AOC files in AX

Hi, static server void refreshAOS(Args _args){    ;     xSession::removeAOC();    SysTreeNode::refreshAll();    SysFlushDictionary::doFlush();    SysFlushAOD::doFlush();    xSession::updateAOC();} Regards, REF: http://www.dynamicsaxlatino.com/limpiar-flush-cache-de-aos-o-aot-en-ax/

Code to refresh AOT in AX

Hi, public server static void refreshServer(){    #AOT ;    TreeNode::findNode(#TablesPath).AOTrefresh();    TreeNode::findNode(#TableMapsPath).AOTrefresh();    TreeNode::findNode(#ViewsPath).AOTrefresh();    TreeNode::findNode(#ExtendedDataTypesPath).AOTrefresh();    TreeNode::findNode(#BaseEnumsPath).AOTrefresh();    TreeNode::findNode(#LicenseCodesPath).AOTrefresh();    TreeNode::findNode(#ConfigurationKeysPath).AOTrefresh();    TreeNode::findNode(#SecurityKeysPath).AOTrefresh();    TreeNode::findNode(#TableCollectionsPath).AOTrefresh();    TreeNode::findNode(#PerspectivesPath).AOTrefresh();    TreeNode::findNode(#MacrosPath).AOTrefresh();    TreeNode::findNode(#ClassesPath).AOTrefresh();    TreeNode::findNode(#ReportsPath).AOTrefresh();    TreeNode::findNode(#ReportTemplatesPath).AOTrefresh();    TreeNode::findNode(#SectionTemplatesPath).AOTrefresh();    TreeNode::findNode(#QueriesPath).AOTrefresh();    TreeNode::findNode(#JobsPath).AOTrefresh();    Dictionary::aodFlush();    Dictionary::dataFlush();    flush UtilElements, UtilIdElements;} Regards,

Code to print Ledger journal balance in AX

static void AlfasithPrintLedgerBalance(Args _args) { LedgerBalanceMainAccountAmounts balance; MainAccountListPageBalanceParameters balanceParameters; MainAccount mainAccount; ; mainAccount = MainAccount::findByMainAccountId( “11120005”); balanceParameters = MainAccountListPageBalanceParameters::construct(); balance = LedgerBalanceMainAccountAmounts::construct(); balance.parmAccountingDateRange(balanceParameters.getStartDate(),balanceParameters .getEndDate()); balance.parmPostingLayer(balanceParameters.getPostingLayer()); balance.parmIncludeOpeningPeriod(balanceParameters.getIncludeOpeningPeriods()); balance.parmIncludeRegularPeriod(balanceParameters.getIncludeOperatingPeriods()); balance.parmIncludeClosingPeriod(balanceParameters.getIncludeClosingPeriods()); balance.parmIncludeClosingPeriodBySystem(balanceParameters.getIncludeClosingPeriods()); balance.calculateBalance(mainAccount); info(strFmt(“%1”, balance.getAccountingCurrencyBalance())); }

15 – 40 Minutes full compilation of AX using CMD prompt

Hi, cd C:Program FilesMicrosoft Dynamics AX60ServerMicrosoftDynamicsAXbinHere \MicrosoftDynamicsAX\ represents the Instance name that you given while installing. axbuild.exe xppcompileall /aos=01 /altbin=”C:Program Files (x86)Microsoft Dynamics AX60ClientBin” /workers=4aos = 01 is the SI NO. you can find that SI for your instance in server configuration. Reference page : http://msdn.microsoft.com/library/d6da631b-6a9d-42c0-9ffe-26c5bfb488e3.aspx Regards,Mohamed Alfasith

Access the other instance DB belongs to same domain but different DB in AX

Hi, static void AlfasithOtherDBAccess(Args _args){    LoginProperty       loginProp;    ODBCConnection      conn;    Resultset           resultSet, resultSetCount; // get record    Statement           statement1, statement2; // Create SQL Statement    ResultSetMetaData   metaData ; // get Record metadate like columnname.    RetailTillLayout   […]

Overcome from divide by zero error in AX

Hi, 2 ways. >>int    a,b,c;if(b)    c = a / b;else print ” Cannot divide by zero” OR c  = a / minOne(b); //it returns a itself if b is zero because minOne() returns non zero values that we passes. If it is zero then it retuns 1 Above methods is to prevent the stoppage […]

Code to get multi selected records in from grid in AX

Hi, Make that object (button) to multiselect property as “YES”.on the control (button) event method (Clicked). void clicked(){      int             ListOfRecIds, i=1;    container  contains;    CustTable  custTableLoc; // Table_Name  that we used in as the datasource.    super();       ListOfRecIds= custTable_ds.recordsMarked().lastIndex();    custTableLoc= custTable_ds.getFirst(1);      while […]

Delete the model files from AX

Hi, Open the command prompt > run > cmdcdcd C:Program FilesMicrosoft Dynamics AX60ManagementUtilitiesAbove location is the AX installed location.axutil delete /model:”Payroll model” /Config:MicrosoftDynamicsAx Here model is the concern model that needs to be deleted & Config is the AOS name. Note: Unless you compile you will not find the difference. Regards,

Date handling in AX 2012

Hi, dateStartMth and dateEndMth in ax 2012//Get day from datedayOfMth(systemdateget()) //Get month from datemthOfYr(systemdateget()) //Get year from dateyear(systemdateget()) // Ger Ist date of the monthdateStartMth (DueDate); // If DueDate = 18111989 this method returns 01111989 // Get Last date of the monthdateEndMth (DueDate) // If DueDate = 18111989 it returns 30111989 // Get no of […]

String Handling in AX

Hi,     str 100     mailBody = ‘Mohamed Alfasith IsmailSuban’;    if(strScan(mailBody,’Suban’,1,strLen(mailBody)))// Checks the presence of the string       print strreplace(mailBody,’Suban’,”Mohamed”); //Replaces the substring in main string…  //Delete the first letter in AXstrDel(“Dynamic AX”,1,1); // it retuns “ynamic” subStr(“Alfasith”,3,5); //Returns the string ‘fasit’.strUpr(“Alfaith”); // Returns the string ALFASITHstrRTrim(“*AX*”); //Returns “*AX”. removes the […]

How to call datasource methods by code in AX.

Hi, TableName_ds.object(fieldnum(TableName,FeildName)).method();RESRentAgreementCreationTmp_ds.object(fieldnum(RESRentAgreementCreationTmp,StartDate)).modified(); Regards,Alfasith Ismail