Announcements
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(); }
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
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.
André Arnaud de Cal...
294,241
Super User 2025 Season 1
Martin Dráb
232,982
Most Valuable Professional
nmaenpaa
101,158
Moderator