Skip to main content

Posts

Showing posts from 2018

Follow this technique to Solve Problem in Year 2019 | Problem solving process

Friends You can Follow this technique to Solve Problem in Year 2019. I hope you will able to understand.

How to add field in Onhand Inventory form in Ax 2012

This is typical question How to add field in Onhand Inventory form in Ax 2012 but I got easy way to solve. Only drag drop field will not help on this query . You need to reach on class InventDimCtrl_Frm_OnHand then find method modifyQuery then you need to add your field in group by otherwise you never be able to add field in on hand form. I hope it will help you a lot You should write code at the Classes\InventDimCtrl_Frm_OnHand\modifyQuery() method  This is called when you open the On Hand form, where Item number is shown and group by with other field.

Tips to Create Customer Address view in Axapta 2012

You can refer relation between table in below image which can help you to create view for Customer address master. Getting customer address is difficult due to multiple table involvement for tables. I hope this image will help you to create customer Address view. Thanks in advance.

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));

How to get Customer,Vendor VAT Registration Number by code in Axapta

To get Customer,Vendor VAT Registration Number by code in Axapta in 2012 version you can try below code in data method on table label then you can use the method in string control on form . This code will work perfectly . display name Get_TaxRegistration() { TransDate _transDate = systemDateGet(); DirPartyLocation dirPartyLocation; TaxRegistration taxRegistration; TaxRegistrationTypeApplicabilityRule taxRegistrationTypeApplicabilityRule; if (_transDate) { dirPartyLocation = DirPartyLocation::findByPartyLocation( this.Party, this.invoiceAddress().Location); if (dirPartyLocation) { select firstonly validTimeState(_transDate) taxRegistration where taxRegistration.DirPartyLocation == dirPartyLocation.RecId join RecId from taxRegistrationTypeApplicabilityRule order by taxRegistrationTypeApplicabilityRule.IsPrimaryAddressRestricted desc

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 to get Miscellaneous charges of purchase line in Ax 2012

This is Code to get Miscellaneous charges of purchase line in Ax 2012. You can try below code to check in job. PurchTable purchTable; PurchLine purchLine; MarkupTrans markupTrans; while select * from purchLine Join purchTable Join markupTrans Where purchTable.PurchId == purchLine.PurchId && markupTrans.TransRecId == purchLine.RecId && purchTable.PurchId=="PO-0000043" { info(strFmt("%1 , %2 , %3",purchLine.PurchId,markupTrans.Txt,markupTrans.Value)); }

Code to approve bom for product in Ax 2012.

Code to approve bom for product in Ax 2012.If you are creating or uploading bom list by code then auto approval may required,below code will help to approve bom item automatically. void God_setBOMActive(BOMId bomid,str 20 approver1) { BOMVersion BOMVersion1; BOMApprove bomApprove = new BOMApprove(); RecId approver = HcmWorker::findByPersonnelNumber(approver1).RecId; boolean ret=true; try { select forUpdate BOMVersion1 where BOMVersion1.BOMId==bomid; BOMVersion1.selectForUpdate(); BOMVersion1.Approved = true; BOMVersion1.Active = true; BOMVersion1.Approver = approver; ttsBegin; BOMVersion1.write(); ttsCommit; bomApprove.init(); bomApprove.parmApprover(approver); bomApprove.parmBOMId(bomid); bomApprove.run(); } catch { info(strFmt("(%1) approval failed.", bomid)); } }

Getting Error on AIF Web service enabling for custom class in Ax 2012

Problem I am Getting below Errors on AIF Web service enabling for custom class in Ax 2012. 1. Application pool 'MicrosoftDynamicsAXAif60' is being automatically disabled due to a series of failures in the process(es) serving that application pool. 2. There was an error during processing of the managed application service auto-start for configuration path: 'MACHINE/WEBROOT/APPHOST/Default Web Site/MicrosoftDynamicsAXAif60'. The error message returned is: 'An initialization error occurred while trying to preload an application. Exception: System.Configuration.ConfigurationErrorsException Message: Duplicate type with name 'Dynamics.Ax.Application.NewItem' in assembly 'Dynamics.Ax.Application, Version=6.3.1000.309, Culture=neutral, PublicKeyToken=null'. StackTrace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)    at System.Web.Configuration.CompilationSection.LoadAllAssembl