public void setSegmentedDefaults()
{
DimensionStorage dimensionStorage;
DimensionStorageSegment segment;
DimensionAttribute dimensionAttribute;
DimensionAttributeValue dimensionAttributeValue;
;
dimensionStorage = DimensionStorage::findById(this.LedgerDimension);
dimensionAttribute = DimensionAttribute::findByName('BusinessUnit');
dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(dimensionAttribute, '002', false, true);
segment = DimensionStorageSegment::constructFromValue('002', dimensionAttributeValue);
dimensionStorage.setSegmentForHierarchy(1, 2,segment);
this.LedgerDimension = dimensionStorage.getSavedComboRecId();
dimensionAttribute = DimensionAttribute::findByName('Department');
dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValueNoError(dimensionAttribute, '024', false, true);
segment = DimensionStorageSegment::constructFromValue('024', dimensionAttributeValue);
dimensionStorage.setSegmentForHierarchy(1, 3,segment);
this.LedgerDimension = dimensionStorage.getSavedComboRecId();
}
Valuable post useful for everyone.Keep on sharing.
ReplyDeleteMS Dynamics Trade and Logistics Online Training