Look up date and calendar in AX

Hi, void lookup(){    ProjPeriodId    projPeriodId = DNGRMParameter::find().PeriodId;    ProjPeriodTo    projPeriodTo;    ProjControlPeriod  projControlPeriod = new ProjControlPeriod();   // projControlPeriod = element.args().caller().runbase();    //if (!projControlPeriod.parmPeriodic())    //{        //if (this.dateValue())        //{            //projPeriodTo = this.dateValue();        //}        //else      […]

Code to call Number sequence in AX 2012

Hi, // You may use in initValue of the table or datasource or for insert the records using the codes.NumberSeq numberSeq;numberSeq = NumberSeq::newGetNum(DpayHRM::EdtName());print  num.num(); // instead of print you may assign to the table. Regards,

Code to run the report in clicked method of the button in AX

Hi, void clicked() {     Args            args;     ReportRun       reportRun;     NSGEosTransactions  esotransactions;     ;      select esotransactions where esotransactions.EosTransId == NSGEosTransactions.EosTransId;     args    = new args();     args.name(reportstr(NSG_EOSReport)); // Report name     args.record(esotransactions);      args.parm(NSGEosTransactions.EosTransId); // Parameter value that I passes.     reportRun = classFactory.reportRunClass(args);     reportRun.init();     reportRun.run(); } Regards,

X++ code to validate & post invent Journal in AX 2012

Hi, static void AlfasithPostJournal(Args _args) {      InventJournalCheckPost      inventJournalCheckPost;     InventJournalTable          inventJournalTable;     ;      inventJournalTable = InventJournalTable::find(“INV-0001245”);     inventJournalCheckPost = InventJournalCheckPost::newJournalCheckPost(JournalCheckPostType::Check, inventJournalTable);     inventJournalCheckPost.parmThrowCheckFailed(true);  // This true enable to prompt the error msg validate the journal     try     {          inventJournalCheckPost.run();     }     catch     {         info(“The journal contains errors.”);     } } *************************************OR************************************* static void AlfasithPostJournal(Args _args) {      InventJournalCheckPost      inventJournalCheckPost;     InventJournalTable          journalTable;     ;      journalTable= […]

Creating a views in AX

Hi,Create views  Create new view Metadata node, right-click on the Data Sources node and select new data source. Change table property to the table name (parent). In the ds of parent table create another ds and select table property as child table. In the child table ds select yes to relation property. Observe If you […]

Dynamic query by linking 2 tables in AX

Hi,Query by linking two tables static void queryEmpDept(Args _args) { Query query; QueryBuildDataSource queryBuildDataSource1,queryBuildDataSource2; QueryBuildRange queryBuildRange; QueryBuildLink queryBuildLink; QueryRun queryRun; DeptTrainingTable deptTrainingTable; EmpTrainingTable empTrainingTable; ; // Create a new query object query = new Query(); // Add the first data source to the query queryBuildDataSource1 = query.addDataSource(tablenum(DeptTrainingTable)); // Add the range to this first data source queryBuildRange = queryBuildDataSource1.addRange(fieldnum(DeptTrainingTable, […]

Write a text file in AX

Hi, static server void WriteTextFile(Args _args){TextIo file;// Using the @ before the filename// enables us to use single path// delimiters. If you don’t use it// you will have to write the path like this:// “c:\temp\cars.txt”FileName filename = @”CDesktopReports.txt”; //Here give your location where to saveEmpTrainingTable empTrainingTable;container con;FileIoPermission permission;#File;try{    // Create the permission classpermission = new FileIoPermission(filename, #io_write);// Add a request for permission before […]

Update sales order line amount through X++

Hi, Static void AlfasithUpdateSalesId(Args _args){SalesLine  salesLine;;ttsbegin;while select forupdate salesline where salesline.salesid == ‘SO-00215’{ salesline.calcLineAmount(); salesline.update();}info(strfmt(“1% Sales id – sales amount was updated”,salesline.salesid ));} Regards,

X++ code to delete the employee

Hi, static void AlfasithDeleteAnEmpl(Args _args){    HcmWorker hcmWorker,hcmWorkerSel;    HcmEmployment  hcmEmployment,hcmEmploymentSel;    DirPartyTable  dirPartyTable,dirPartyTableSel;    DirPerson      dirPerson,dirPersonSel;    DirPersonName  dirPersonName,dirPersonNameSel;    DirAddressBookParty  dirAddressBookParty,dirAddressBookPartySel ;        int n=0;    ;      select hcmWorker where  hcmWorker.PersonnelNumber == “000097”;    // If you dont select particular personnel number you can delete complete employees..  […]

Release the product using X++

Hi, static void AlfasithReleaseProducts(Args _args){ EcoResProductReleaseManagerBase::releaseProduct(                EcoResProduct::findByProductNumber(‘1022214’).recId,            CompanyInfo::findDataArea(‘CEU’).RecId);    info(“Product released”);    // here Product name and item name & Product ID and Item Id will be same…} Regards,

DMF issue – Access denied for the user – On clicking preview data

Hi, DMF issue -“Access denied for the user” on-clicking preview data in after validating. 1.This error will be retained even you add the user into Microsoft Dynamics AX Data Import Export Framework Service Users . For that we need to update the server (Windows updates ) and restart the server.  This will solve your issue. Regards,

DMF issue – Access denied for the user

Hi, “Access denied for the user”.This error will be prompted in many cases.This is post will solution for the prompt during the validation of shared folder and my next post will be explain to preview records after validating. 1. Make sure that concern folder granted with full rights to everyone. 2. in shared working directory […]

DMF issue – The version of Microsoft Excel is not supported.

Hi, “The version of Microsoft Excel is not supported.-The ‘Microsoft.ACE.OLEDB.12.0’ provider is not registered on the local machine” When this error prompts then we need to install the driver for th MS excel with reference to the OS bit (32 or 64). Microsoft Access Database Engine 2010 Redistributable’ (AccessDatabaseEngine_x64.msi) for 64 and same file ends […]

AX client cache is stored as *.aoc file

Hi, where are stored the parameters for the user session ?This is the local location of every client system bears the *.aoc file for client cache. C:Documents and Settings\local settingsapplication data*.aoc On clearing the individual cache will make ease on cleaning their concern sessions records. Note: *.aoc file will be cleared on every AOS restart.Regards,

Hot fixes for Microsoft Dynamics AX 2012 R3

Hi, Hot fixes for Microsoft Dynamics AX 2012 R3 Partner source link to download the hot fixes.   KBNumber Area Path Integration Build Title 2989855 DAXSEHuman ResourcesPayroll Earning code groups 2989197 DAXSEHuman ResourcesHR Unable to delete or modify existing fixed compensation records 2983634 DAXSEClient Not able to open the AOT developer workspace in […]

Warning cum error “Access Is denied For the user” in DMF AX 2012 R3

Hi, Solution: 1. Add the concern user in ‘Microsoft Dynamics AX Data Import Export Framework Service Users local group’  in server where DMF service is running. 2. Make the directory shared with everyone in read/write privileges. 3. Must restart the server not AOS , Its server (system)  Note: sometimes it will not be validated until […]

AX build number (version)

Microsoft Dynamics AX 2012 R3     (Roadmap survey) Version Build Comment Download link Recent kernel build 6.3.3000.2173 20 Mar 2016 KB3150221 Cumulative Update 10 6.3.3000.110 24-Nov-15 KB3102920 Cumulative Update 9 6.3.2000.326* 08 Jun 2015 KB3063879 Cumulative Update 8 6.3.1000.309 18 Nov 2014 KB2998197 Hotfixes 6.3.1000.xxxx Since 2015 LCS > Issue search Hotfixes 6.3.164.xxxx Until 2015 LCS > Issue search RTM 14-Apr […]