Posts

Showing posts from 2016

Unit Conversion by code in ax 2012 R3 , X++

static void unitConversion() {     SysExcelApplication xlsApplication;     SysExcelWorkBooks xlsWorkBookCollection;     SysExcelWorkBook xlsWorkBook;     SysExcelWorksheets xlsWorkSheetCollection;     SysExcelWorksheet xlsWorkSheet;     SysExcelRange xlsRange;     SysExcelCells Cells;     SysExcelCell RCell;     CommaIO inFile;     int nRow,i;     DialogField dialogPath;     Dialog dialog;     Filename filename;         UnitOfMeasureConversion             unitOfMeasureConversion;     UnitOfMeasure                       unitOfMeasure;     EcoResProduct                       ecoResProduct;     RecId               ...

AIF Document Service Invalid Data Container Type

Error: Invalid data container type. Resolution: Compile forward  AfStronglyTypedDataContainer  class. Ref

Update Ledger dimension through code in AX 2012 R3 (Account Structure) X++

Public void updateLedgerDimension(str 30 finMainaccount,str finArea,str fnCostCenter,str finFamily,str finBussiness,str finProject,str finSeason,str finCompany) {     List ListValueContract = new List(Types::Class);     DimensionServiceProvider DimensionServiceProvider = new DimensionServiceProvider();     LedgerAccountContract LedgerAccountContract = new LedgerAccountContract();     updateValue = false;     if(finArea)     {         ValueContract = new DimensionAttributeValueContract();         ValueContract.parmName('Area') ;         ValueContract.parmValue(finArea);         ListValueContract.addEnd(ValueContract);     }     if(fnCostCenter)     {         ValueContract = new DimensionAttributeValueContract();         ValueContract.parmName('CostCenter') ; ...

Get Dimension Value from ledger dimesion through X++ AX 2012 R3

static void getDimValue(Args _args) { str 30 finMainaccount, finArea, finBussiness, fnCostCenter, finFamily, finSeason, finProject, finCompany; DimensionAttributeLevelValueAllView dimAttrView; //View that will display all values for ledger dimensions     DimensionAttribute                  dimAttr; //Main dimension attribute table     int i;         i++;         while select DisplayValue from dimAttrView             where dimAttrView.ValueCombinationRecId == generalJournalAccountEntry.LedgerDimension             join Name from dimAttr                 where dimAttr.RecId == dimAttrView.DimensionAttribute         {             switch (dimAttr.Name)             {         ...

Deleting unused Main Account Values in Ax 2012

A financial dimension value is based on the Main Account  record and has been used on a transaction, You cannot delete the Main Account record.  In order to get rid off un-used dimension values, delete the related records in the following tables 1.DimensionAttributeValueCombination By default the ledger dimension values are stored in DimensionAttributeValueCombination. The DimensionAttributeValueCombination table contains information about accounts and various dimensions combinations that are used. Anything that uses dimensions will hold reference to a record on this table.   2.DimensionAttributeLevelValue This table contains the usage of  a dimension attribute value in a given dimension hierarchy. 3.DimensionAttributeValueGroup This table represents a group of values for the specific dimension set. 4.DimensionAttributeValueGroupCombination It contains the usage of dimension code groups in a  dimension code combination. It allows a group to be re-us...

How to select multiple value from lookup in ax 2012

Image
Hi, Today we will see how to select multiple value from dropdown lookup. In this case we will select multiple customer account num. Step 1: Create a query Step 2 : In this example I have created a table  but you can use existing one. I have added one field account number. Step 3 : As I have created a new table , so I have to create new form too. Again you can continue with existing form. Step 4 : Now Add below method in form methods 1. public class FormRun extends ObjectRun { SysLookupMultiSelectCtrl msCtrl; } ------------------------------------------------------------------------------------------------------------- 2. public void init() { Query query = new Query(); super (); msCtrl = SysLookupMultiSelectCtrl::construct(element, S3_AccountTable_AccountNum, querystr (CustTablelookup)); } -----------------------------------------------------------------------------------------------------------...

Confirm PO through Code in X++ 2012

static void POConfirmCode(Args _args) { SysExcelApplication xlsApplication; SysExcelWorkBooks xlsWorkBookCollection; SysExcelWorkBook xlsWorkBook; SysExcelWorksheets xlsWorkSheetCollection; SysExcelWorksheet xlsWorkSheet; SysExcelRange xlsRange; SysExcelCells Cells; SysExcelCell RCell; CommaIO inFile; #define.ExampleOpenMode( "r" ) int nRow,i; DialogField dialogPath; Dialog dialog; Filename filename; Name Name; PurchFormLetter purchFormLetter; PurchFormletterParmData purchFormLetterParmData; PurchParmUpdate purchParmUpdate; PurchParmTable purchParmTable; PurchParmLine purchParmLine; PurchTable ...