Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

DimensionStorage Cross Company Segment name

(0) ShareShare
ReportReport
Posted on by 5

I'm developing an srss report on a GeneralJournalAccountEntry (Cross comapny) table and when I use DimensionStorage to get names of ledger dimensions segments
Using this code (using Job here for simplification only) it works correctly at the same company, but the rest of the company returns with an empty string.

How can I retrive all names of ledger dimensions segments for all companies?


static void TestJob(Args _args)
{
    
    //LedgerDimension ==>  5637150044  ==> from GeneralJournalAccountEntry table
    DimensionStorage dimensionStorage;
    Name                  Segmentname;
    DimensionStorageSegment  seg;

    dimensionStorage=  DimensionStorage::findById(5637150044);

    seg = dimensionStorage.getSegment(2);
    Segmentname = seg.getName();


}

static void Job1(Args _args)
{
    //LedgerDimension ==>  5637150044  ==> from GeneralJournalAccountEntry table
    DimensionStorage dimensionStorage;
    Name                  Segmentname;
    RecId                   id;


    dimensionStorage=  DimensionStorage::findById(5637150044);
    id = dimensionStorage.getSegment(2).parmDimensionAttributeValueId();
    Segmentname = DimensionAttributeValue::find(id).getName();


}

  • Abanob Adel Profile Picture
    5 on at
    RE: DimensionStorage Cross Company Segment name

    ethis is screenshot from debug TestJob()  from two different companies 

    the first one return the name because the LedgerDimension ==>  5637150044 exist in this company.

    the second return empty name.

    This scenario happens even if they have the same account  structure.

    I expect that I want to get the correct name even if from another company is there a possibility to change the company in the runtime during report processing or even point to  the company through any accepted variable by DimensionStorage

    3223.Untitled2.png7026.Untitled.png

  • Martin Dráb Profile Picture
    232,982 Most Valuable Professional on at
    RE: DimensionStorage Cross Company Segment name

    Where does your code fails? Does dimensionStorage.getSegment(2) returns anything? Segments are populated inside findById(), therefore you can debug this method to see what's going on.

    Do the companies use the same account structure? If not, what result do you expect to get? There may be so such a segment at all or a segment with a completely different meaning.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,241 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,982 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans