Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Financial Dimension after save is empty

(0) ShareShare
ReportReport
Posted on by

I have financial dimension which contact values like BuildingID and ContractID. When new building is created, dimension is properly filled with data. But, after that there is need for contract creation. When contract is created there is value in financial dimension field for contractID. But, when contract is saved, financial dimension for contract id disappear. When I check in DIMENSIONATTRIBUTEVALUESET table value for that ContractID dimension is null, there is only value for BuildingID. I have this method for init dimensions. Am I missing something?

void initDimensions()
    {        
        DimensionDefault dimension;
        PMGOrgDimension orgDimension;
        CompanyId       companyId;        
        PMEGround ground;
        PMEBuilding building;

        switch(pmcContract.EstateType)
        {            
            case PMCEstateType::Ground :
                ground = PMEGround::find(pmcContract.EstateId);
                dimension    = PMEObjectLegalEntity::find(ground.TableId, ground.RecId).DefaultDimension;
                orgDimension = ground.OrgDimension;
                companyId    = ground.CompanyId;
                break;
            case PMCEstateType::Building :
                building = PMEBuilding::find(pmcContract.EstateId);
                dimension    = PMEObjectLegalEntity::find(building.TableId, building.RecId).DefaultDimension;
                orgDimension = building.OrgDimension;
                companyId    = building.CompanyId;
                break;
            default :
                dimension = pmcContract.DefaultDimension;
                orgDimension = pmcContract.OrgDimension;
                companyId = pmcContract.CompanyId;
                break;
        }

        pmcContract.DefaultDimension    = dimension;
        pmcContract.OrgDimension = orgDimension;
        pmcContract.CompanyId    = companyId;

    } 

*This post is locked for comments

  • RE: Financial Dimension after save is empty

    Hello Andre,

    Unfortunately not. I found the root cause of the issue, but don't get it, why this merge is not working.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,516 Super User 2025 Season 1 on at
    RE: Financial Dimension after save is empty

    Hi Darko,

    So your question has been answered now? Or do you need some additional information?

  • RE: Financial Dimension after save is empty

    Hi Andre, me again. Find exact issue. Merging in method is not done, at all.

    static server public DimensionDefault tableDimension(Common _c, DimensionDefault _d)
        {
            DimensionAttribute dimensionAttribute;
            DimensionAttributeValue dimensionAttributeValue;
            DimensionAttributeSetItem dimensionAttributeSetItem;
            DimensionAttributeValueSetStorage dimensionAttributeValueSetStorage;
            DimensionDefault cDimensionDefault;
            DimensionDefault ret;
            ;
    
            ret = _d;
    
            select firstonly RecId from dimensionAttribute
                where dimensionAttribute.BackingEntityTableId == _c.TableId
                join firstonly RecId from dimensionAttributeSetItem
                    where dimensionAttributeSetItem.DimensionAttributeSet == DimensionCache::getDimensionAttributeSetForLedger()
                       && dimensionAttributeSetItem.DimensionAttribute == dimensionAttribute.RecId;
            if (dimensionAttributeSetItem.RecId != 0)
            {
                dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndEntityInst(dimensionAttribute.RecId, _c.RecId, false, true);
                if (dimensionAttributeValue.RecId != 0)
                {
                    dimensionAttributeValueSetStorage = new DimensionAttributeValueSetStorage();
                    dimensionAttributeValueSetStorage.addItemValues(dimensionAttributeValue.DimensionAttribute, dimensionAttributeValue.RecId, dimensionAttributeValue.HashKey);
                    cDimensionDefault = dimensionAttributeValueSetStorage.save();
                    if (cDimensionDefault != 0)
                    {
                        ret = LedgerDimensionDefaultFacade::serviceMergeDefaultDimensions(cDimensionDefault, _d);
                    }
                }
            }
    
            return ret;
        }

  • RE: Financial Dimension after save is empty

    Hello Andre,

    Thank you on your response. I reviewed all, table, form, method, probably issue is in DimensionHelper class, it taking only one value. In source table (PMCContract):

    public void updateContractDimension()

    {

    this.DefaultDimension = PMGDimensionCl::tableDimension(this, this.DefaultDimension);

    }

    
    
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,516 Super User 2025 Season 1 on at
    RE: Financial Dimension after save is empty

    Hi devcepticon,

    Did you debug the coding to see what is actually happening? I do think the initDimensions method is working as you can see values. Can you verify other methods on the form and/or table related to insert, update or write actions if there might be something which actually blanks the dimensions?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February 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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans