Skip to main content

Posts

How to convert Amount in Accounting currency in Ax 2012

To convert Amount in Accounting currency in Ax 2012 you can take help of below code, first you need to find accounting currency then you can pass the value of currency using method calculatecurrencytocurrency . Here an example to convert delivery remainder to accounting currency. Ledger ledger; Currencycode accCurrency; CurrencyExchangeHelper currencyExchangeHelper; AmountMst amountMST; select ledger where ledger.PrimaryForLegalEntity == CompanyInfo::findByCompany_IN(curext()).RecId; accCurrency = ledger.AccountingCurrency; currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet()); amountMST = currencyExchangeHelper.calculateCurrencyToCurrency(this.CurrencyCode , accCurrency ,1 , true); return this.SalesPrice * this.RemainSalesPhysical * amountMST;

Auto Submit Workflow for Approval in Ax 2012

Sometimes we need to submit Auto Submit Workflow for Approval in Ax 2012 then you can try below code by job. One thing you need to remember submitter should not be approval in workflow designer if its then this job may create some issue on approval. Rest is fine you can use this code for your customization. Inventtable inventtable =InventTable::find("628034tr1"); Workflow::activateFromWorkflowType("InventApprWFType", //Template name inventtable.RecId, //Record id of the document that you are submitting, 'Auto-Submitted into workflow', //A comment for the workflow history to know something about how this was submitted, false,//This document wasn't submitted from the web, 'userid1'); // T info("done");

X++ code for Project Item Requirement posting in Ax 2012

Below is the X++ code for Project Item Requirement posting in Ax 2012. SalesFormLetter salesFormLetter; salesTable Salestablelocal; str 200 msg; if(this.parmSalesid()) { changeCompany(_legalentity) { select Salestablelocal where Salestablelocal.Salesid ==this.parmSalesid() && Salestablelocal.salestype==SalesType::ItemReq && Salestablelocal.SalesStatus==SalesStatus::Backorder; if(Salestablelocal) { ttsBegin; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation); salesFormLetter.update(Salestablelocal); salesFormLetter = SalesFormLetter::construct(DocumentStatus::ProjectPackingSlip); salesFormLetter.update(Salestablelocal); ttsCommit; msg = "Item Requirement with Sales order id : " + this.parmSalesid() + " Posted "; } else

Seeking help to get Miscellaneous charges for Purchase order in Ax 2012

If you are Seeking help to get Miscellaneous charges for the Purchase order in Ax 2012 then this code can help you. Sometimes we need to display Miscellaneous charges total in the report then you can get help as per below code. while select sum(Value),MarkupCode from markuptrans_txt group by MarkupCode join purchline where purchline.RecId ==markuptrans_txt.TransRecId && markuptrans_txt.TransTableId == purchline.tableid && purchline.PurchId == vendPurchOrderJour.PurchId && markuptrans_txt.Value != 0.00 { purchPurchaseOrderHeader.MiscChargeDesc = purchPurchaseOrderHeader.MiscChargeDesc+strFmt("Add %1 : \n",MarkupTable::find(MarkupModuleType::Vend,markuptrans_txt.MarkupCode).Txt ) ;

Get particular Financial dimension value from default dimension in Axapta

To get particular dimension value from default dimension you can try below code as per your requirement. DimensionAttributeValueSetItem dimvalue; DimensionAttributeValue dimAttValue; DimensionAttribute dimAtt; int length; //DimAttributeOMCostCenter viewCostCenter; DimensionFinancialTag viewCostCenter; DimAttributeOMDepartment viewDepartment; DimensionFinancialTag locations; str name; ; length = 0; Select dimvalue join dimAttValue join dimAtt Where dimvalue.DimensionAttributeValueSet == _DimensionDefault && dimvalue.DimensionAttributeValue == dimAttValue.RecId && dimAttValue.DimensionAttribute == dimAtt.RecId && dimAtt.Name == 'ProductCategory'; select viewCostCenter where viewCostCenter.Value == dimValue.DisplayValue; return viewCostCenter.Description;

Import Budget Register line In Ax 2012

To Import Budget Register line In Ax 2012, you get Idea from below code. You need to create budget register header then you can your CSV file and apply the code to import. you also need to declare variables as used in below code. budgetTransactionLine = new AxBudgetTransactionLine(); budgetTransactionLine.parmBudgetTransactionHeader(BudgetTransactionHeader::findByTransactionNumber(c1,Ledger::current()).RecId); budgetTransactionLine.parmDate(str2Date(c2,123)); budgetTransactionLine.parmTransactionCurrency(c10); budgetTransactionLine.parmBudgetType(str2enum(budgetType,c11)); budgetTransactionLine.parmTransactionCurrencyAmount(str2num(c9)); budgetTransactionLine.parmAccountingCurrencyAmount(str2num(c9)); accEntryPattern = [strFmt("%1-%2-%3-%4-%5-%6-%7",c3,c4,c5,c6,c7,c8),c3]; if(c4) { accEntryPattern += "LegalEntity";