Skip to main content

Posts

Showing posts with the label Ax 2012

Solved : Timeout Error on AIF Web Service inbound during call by code in Axapta

If you are facing Timeout Error on AIF Webservice  inbound  during call code in ax 2012 then you need to increase timeout setting in web-service port configuration. Steps to resolve this error is as below. 1. Go to System Administration menu. 2. Go  to this path \Menus\SystemAdministration\Setup\Services and Application Integration Framework\Inbound ports 3. Select the service port which you want to set timeout then disable the service. 4. Click on configuration. 4. Set the time out receive timeout, sent timeout,open timeout etc 5. After setting time out Enable web service port again. 6. Now check and run code for timeout issue get resolved.

Batch job History Log Cleanup code in Axapta till specified date

You can clear log for batch job history in Ax by following code. This code can work in most of ax version . If you want to clear  log till some date that you can also specify in query . You can just copy and paste below code run or execute. BatchJobHistory BatchJobHistory; date startDate; TimeOfDay startTime; utcDateTime rangeStart; startDate=mkDate(21,12,2014); startTime = str2time("6:00:00 am"); rangeStart = DateTimeUtil::newDateTime(startDate,startTime); delete_from BatchJobHistory where BatchJobHistory.createdDateTime<rangeStart; //select count(RecId) from BatchJobHistory where BatchJobHistory.createdDateTime<rangeStart ; // info(strFmt("%1 till cleanup done ",BatchJobHistory.RecId)); info(strFmt("%1 till cleanup done ",rangeStart));

Code to Confirm and Post Project Item Requirement for Sales Order in Ax 2012

This is a sample Code to confirm and Post Project Item Requirement for Sales Order in Ax 2012 . You need to pass sales order in salesFormLetter class method update and you can pass transaction date or posting date as per your need it will create or post project sales order item requirement packing slip. Its same functionality as post button on project item requirement form. SalesFormLetter salesFormLetter; salesTable Salestablelocal; str 200 msg; salesid salesid; if(salesid) { select Salestablelocal where Salestablelocal.Salesid ==salesid && Salestablelocal.salestype==SalesType::ItemReq && Salestablelocal.SalesStatus==SalesStatus::Backorder; if(Salestablelocal) { ttsBegin; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation); salesFormLetter.update(Salestablelocal); salesFormLetter = SalesFormLetter::constru

Code to get opening balance for Ledger Main account in Ax 2012

If you want to check opening balance for particular main account then you can check below code to get the same. This is sample Code to get opening balance for Ledger Main account in Ax 2012. LedgerBalanceMainAccountAmounts ledgerBalance; AmountMst opSum; ; ledgerBalance = LedgerBalanceMainAccountAmounts::construct(); ledgerBalance.parmIncludeRegularPeriod(true); ledgerBalance.parmIncludeOpeningPeriod(true); ledgerBalance.parmIncludeClosingPeriod(false); ledgerBalance.parmAccountingDateRange(mkDate(01,01,2000), mkDate(31,12,2017)); ledgerBalance.calculateBalance(MainAccount::findByMainAccountId('1123333')); opSum = ledgerBalance.getAccountingCurrencyBalance(); info(num2str(opSum,10,2,1,1));

Code sample to open existing excel file in Axapta

Code sample to open excel file in Axapta. You can use below code in any version of Axapta. First, you need to paste the file in particular folder path then you can open it by using job or class. You can check below code through job x++ editor. This code can be helpful if you want to provide the menu item to export template for the user. fileName = "C:\\Users\\Public\\Documents\\TestTemplate.xlsx" ; WinAPI::shellExecute(fileName); WinAPI::setFileAttributes(filename,1);

Online Practical to Create Security Role,Privileges,Duties in Ax 2012

If you want to learn How to Create Role ,Privileges,Duties in Ax 2012 then You can follow below . Steps are as below These are the steps How to create new role for Form display menu item in Ax 2012 1.Go to Menu item and create new menu item attach form object in properties. 2.Go to AOT security note and go to  privilege and create new privilege then drag menu item to entry point. 3.Go to duty and create new Duty drag created privilege to duty. 4. Go to role and create new role and drag duty and privilege to role. Now you can see your role for assigning to users on users form Same steps you can view on below clip on YouTube. You can subscribe video to learn more and get update for new version like dynamics 365.

What are the Tools to analyse dumps Crash of Ax ,LCS

Design user control,Add lookup, Selected Index change code in Ax 2012

Design user control To design user control you need to open visual studio then you can create new user control on form designer you can do below steps. add data source- add formid-add axsection=add grid or group Then Add lookup.   Add dataset add control for lookup and set dataset and fields in  Add range on init method or any other method to get range value filter Autopostback to true property on field to save data immediately. selectedindexchangeevent code this.AxDataSource1.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("datasourceRefresh",DropDownList1.SelectedItem.Text);

Workflow infrastructure configuration wizard in Ax 2012

Workflow infrastructure configuration wizard. 1. Click Area Page node: System administration -> Setup -> Workflow -> Workflow infrastructure configuration. 2. Click the Next > button. 3. Switch to the Configure the workflow message processing batch job tab on the Workflow infrastructure configuration wizard form. 4. Click the Next > button. 5. Switch to the Configure the workflow due date processing batch job tab on the Workflow infrastructure configuration wizard form. 6. Click the Next > button. 7. Switch to the Configure the line-item workflow notifications batch job tab on the Workflow infrastructure configuration wizard form. 8. Change Repeat job after the specified number of minutes from '30' to '1'. 9. Click the Next > button. 10. Switch to the Completing the workflow infrastructure configuration wizard tab on the Workflow infrastructure configuration wizard form. 11. Click the Finish button. 12. Close the Wo

Remove spaces from Text in Ax 2012

To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side . Dirpartytable Dirpartytable; Name Name; ; while select forUpdate Dirpartytable { ttsBegin; Name= strRTrim(strLTrim(Dirpartytable.Name)); Dirpartytable.Name = Name; Dirpartytable.doUpdate(); ttsCommit; } info("Done");

Update and Update_RecordSet Code sample in Ax 2012

This is Update and Update_RecordSet Code sample. Result of both will be same . TestTable TestTable; //Update_Recordset update_recordset TestTable setting Name ="New Enterprises" where TestTable.Accountnum =="uS-027"; //Update ttsBegin; while select forupdate TestTable where TestTable.Accountnum =="uS-027" { TestTable.Name ="New Enterprises"; TestTable.update(); } ttsCommit; info("OK");

Call SSRS Report through controller class in ax 2012

To Call SSRS Report through controller class  Go to main method in controller class and write below code to call the report. SSRSRPTController controller; controller = new SSRSRPTController(); controller.parmArgs(args); controller.parmReportName(ssrsReportStr(TestReport, report)); controller.parmShowDialog(true); controller.startOperation()

Ax 2012 code,Get Inventory On hand qty for item of inventory dimension

InventDimOnHand _inventOnhand; InventDimOnHandIterator _InventDimOnHandIterator; InventDimOnHandMember _InventDimOnHandMember ; ItemId itemId; InventDim _inventDim; InventDimParm _inventDimParm, inventDimParmOnHandLevel; InventDim inventDim; InventDimOnHandLevel _InventDimOnHandLevel; ; itemId = '76576'; _inventDim.InventLocationId = '1113'; _inventDim = InventDim::findOrCreate(_inventDim); _inventDimParm.InventLocationIdFlag = true; _InventDimOnHandLevel = InventDimOnHandLevel::DimParm; inventDimParmOnHandLevel.ItemIdFlag = true; inventDimParmOnHandLevel.InventLocationIdFlag = true; inventDimParmOnHandLevel.WMSLocationIdFlag = true; inventDimParmOnHandLevel.InventBatchIdFlag = true; _inventOnhand = InventDimOnHand::newAvailPhysical(itemId, _inventDim, _inventDimParm, _InventDimOnHandLevel, inventDimParmOnHandLevel); _InventDimOnHand

AOT Components preview in dynamics Axapta 2012

Following are AOT Components preview in Microsoft dynamics Axapta 2012, In Ax 2012 Parts,Visual Studio projects etc are new component added in AOT. You can see lot of changes in form design but base method and code are same as ax 2009.