Skip to main content

Posts

Showing posts with the label info

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

How to Update Project Status by Code in Ax 2012

To Update Project Status by Code in Ax 2012 You can get help from below code sample. In this code if Project status is created then it will update to In process stage. Same way you can try as per your requirement. Projtable projTable; int cnt; ttsBegin; while select forUpdate projtable where projTable.Status==ProjStatus::Created { cnt++; projtable.Status=ProjStatus::InProcess; projtable.update(); } ttsCommit; info(strFmt("%1 Project Updated",cnt));

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

Find Ledger Account Id by Ledger dimension in Ax 2012

To Find Ledger Account Id by Ledger dimension in Ax 2012 you can get hint from below code. findByLedgerDimension is a method defined in Mainaccount table where you can pass ledgerdimension value . MainAccountId is field name which is created in MainAccount Table. MainAccount Table is main master table for Ledgers. info(strFmt("%1",MainAccount::findByLedgerDimension(3427167077).MainAccountId));

Get or split values start and end from range in Ax 2012

This is code sample to Get or split values from range in Ax 2012. For example you provided range from 100 to 110 and want both value start value and end value in some variable then you can use container to split range values. str range; str startValue,endValue; List ledgerRange= new list(Types::String); ListIterator listiterator; container con; range = "100..110"; rangevalue= strSplit(range,".."); listiterator = new listiterator(rangevalue); while(listiterator.more()) { con += listiterator.value(); listiterator.next(); } startValue = conpeek(con,1); endValue = conPeek(con,3); info(startValue); info(EndValue);    

Left Outer Join in Ax 2012

You can use Left Outer Join in Ax 2012 following way. There is no Right Outer join  in Ax 2012. Default outer joint is left outer join so there is not left keyword is used in query. while select AccountNum from LedgerTable order by AccountNum outer join * from LedgerTrans where LedgerTrans.AccountNum == LedgerTable.AccountNum { info(strfmt("%1-%2", LedgerTable.AccountNum, LedgerTrans.AmountMst)); }