Posts

Showing posts from August, 2013

Create Vertical & Horizontal splitter on a Form

Image
Create a Form in AOT, in form class declaration add following code SysFormSplitter_Y               formSplitterHorizontal; SysFormSplitter_X               formSplitterVertical; Design the form with groups as shown below with properties of  CtrlSplitHorizontal , CtrlSplitVertical groups. On the form init method add following code formSplitterHorizontal = new SysFormSplitter_Y(CtrlSplitHorizontal, GroupTable, this);     formSplitterVertical = new SysFormSplitter_X(CtrlSplitVertical, GroupLineLeft, this); On the  CtrlSplitHorizontal  override the following methods  public int mouseDown(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift) {     super(_x, _y, _button, _Ctrl, _Shift);     return formSplitterHorizontal.mouseDown(_x, _y, _button, _ctrl, _shift); } public int mouseMove(int _x, int _y, int _but...

Build Financial dimension based on other dimension values in AX 2012

Image
From the above example, If you want to get the CostCenter (first 4 chars)  & deparment (2-3 chars) from ExpensePurpose, we have to customize some standard classes to achieve it. DimensionDefaultingControllerBase class manages the display, user interaction and storage of default dimension check boxes, combo boxes and values. In DimensionDefaultingControllerBase class customize the LoadAttibuteValueSet method to create the CostCenter & Department. The _dimAttributeValueSetId is the DefaultDimension recId which has the value user entered in ExpensePurpose field. You can write separate method to retrieve the details of Financial Dimension from _dimAttributeValueSetId  & prepare your own DefaultDimension recId and reassign to _dimAttributeValueSetId.

Get Sales Order Totals using X++

Image
We can make use of standard class SalesTotals to get the Totals subform related fields data through X++. SalesTotals returns a container with lot of fields in it, Some of them i have listed below. static void SalesOrderTotal(Args _args) {     SalesTotals     salesTotals;     SalesTable      salesTable;     container       displayFields;     str             totalTax,  amountInclTax, amountWithoutTaxTxt;     AmountMST       amountWithoutTax;          salesTable = salesTable::find('S000076');     salesTotals  =  SalesTotals::construct(salesTable, salesUpdate::All);     salesTotals.calc();     displayFields =  salesTotals.displayFieldsCurrency(salesTotals.currencyCode());     amountWithoutTaxTxt     = conpeek(displayFields, ...