Monday, February 24, 2014

Get indiviual segment from a DimensionAttributeValueCombination recID

Wrote a simple job today to collect individual segment from a DimensionAttributeValueCombination record. In case you have any use of it:

static void GetFinDimsFromLedgerAccountDimension(Args _args)
    LedgerDimensionAccount ledgerDimension = 5637147578;
    DimensionDefaultingEngine engine = DimensionDefaultingEngine::construct(ledgerDimension);    
    DimensionStorage storage = engine.getStorage();    
    DimensionStorageSegment segment;    
    DimensionAttributeValue dimAttrValue;    
    DimensionAttribute dimAttr;    
    int i;
    for (i=1; i<=storage.segmentCount(); i++)
        segment = storage.getSegment(i);
        dimAttrValue = DimensionAttributeValue::find(Segment.parmDimensionAttributeValueId());
        dimAttr = DimensionAttribute::find(dimAttrValue.DimensionAttribute);
        info (strFmt("%3 >> %2  (%1) ",segment.getName(), segment.parmDisplayValue(), DimAttr.Name));
This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment