Posts

Showing posts from November, 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...