D365FFO – AX – Modify/update the Default dimensions through X++

HcmWorker hcmWorker;HcmEmployment hcmEmployment,hcmEmploymentup;DimensionAttributeValueSetStorage dimStorage = new DimensionAttributeValueSetStorage();DimensionAttribute dimAttrC,dimAtrrCC;DimensionAttributeValue dimAttrCValue,dimAtrrCCValue;DimensionDefault defaultDimension; int i;str costcenter1,costcenter2, name1,name2; dimStorage = DimensionAttributeValueSetStorage::find(this.NewDefaultDimension); for (i=1 ; i<= dimStorage.elements() ; i++){if(i==1){name1 = DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name; // cost centercostcenter1 = dimStorage.getDisplayValueByIndex(i);}else{name2 = DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name; // classcostcenter2 = dimStorage.getDisplayValueByIndex(i);}} select firstonly hcmWorker where hcmWorker.PersonnelNumber == this.PersonnelNumber;select firstonly hcmEmployment where hcmEmployment.Worker == hcmWorker.RecId; defaultDimension = hcmEmployment.DefaultDimension;dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension); … Continua a leggere D365FFO – AX – Modify/update the Default dimensions through X++

D365FFO – AX – Create default dimension using x++

Default dimensions are used very commonly in D365FO and DAX 2012. During development or customization of the system, it is very common that we often stuck at the time when we have to create default dimension using our own dimension values. To solve this problem, I am sharing this code. You just have to alter … Continua a leggere D365FFO – AX – Create default dimension using x++

D365FFO – AX – Modify / Update the Default Dimension in AX 2012 R3 Using X++ Code.

Modify/ Update the Default Dimension  in AX 2012 R3 Using X++ Code. static void RB_ModifyDimension(Args _args){     ItemId      itemId;    str         costCentre;     DimensionAttributeValueSetStorage   dimStorage = new DimensionAttributeValueSetStorage();    DimensionAttribute                  dimAttribute;    DimensionAttributeValue             dimAttributeValue;    … Continua a leggere D365FFO – AX – Modify / Update the Default Dimension in AX 2012 R3 Using X++ Code.