Tuesday, December 7, 2021

How to remove the value of a default dimension of a record in D365FO

 How to remove the value of a default dimension of a record in D365FO.


public void removeDimension(LedgerDimensionValueSet _defaultDimension) { DimensionAttributeValue dimAttrValue; DimensionAttribute dimAttr; DimensionAttributeValueSetStorage dimensionAttributeValueSetStorage; dimensionAttributeValueSetStorage = DimensionAttributeValueSetStorage::find(_defaultDimension); dimAttr = DimensionAttribute::findByName('DimensionName'); dimensionAttributeValueSetStorage.removeDimensionAttributeValue( DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr, 'DimensionValue').RecId); } 


Keep daxing!!

No comments:

Post a Comment