Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Unable to return DimensionAttributeValue record as no record exists in DimensionFinancialTag

(0) ShareShare
ReportReport
Posted on by 5

Hello All - I'm creating a sales order for a specific retail store using X and getting below mentioned error, please help me to fix this.

Unable to return DimensionAttributeValue record for Dimension CC with value <blank> as no record exists in table DimensionFinancialTag through view DimensionFinancialTag
Note: I got this error only on UAT environment, On Development environment its working perfectly. All the configurations of financial dimensions are same on both environments. 
The code i used to get the financial dimensions is below

 

retailChannelTbl.clear();
select DefaultDimension from retailChannelTbl
    where retailChannelTbl.INVENTLOCATION == inventLocation.InventLocationId;

dimAttrCCValue = CfzSalesOrderDataProvider::getDimensionDisplayValue(retailChannelTbl.DefaultDimension, 'CC');
dimAttr = DimensionAttribute::findByName('CC');
dimAttrValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr, dimAttrCCValue, false, true);
if (dimAttrValue)
{
    dimavss.addItem(dimAttrValue);
}
/***********************************************************************/
dimAttrCCValue = CfzSalesOrderDataProvider::getDimensionDisplayValue(retailChannelTbl.DefaultDimension, 'BC');
dimAttr = DimensionAttribute::findByName('BC');
dimAttrValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr, dimAttrCCValue, false, true);
if (dimAttrValue)
{
    dimavss.addItem(dimAttrValue);
}
/***********************************************************************/
dimAttrCCValue = CfzSalesOrderDataProvider::getDimensionDisplayValue(inventTable.DefaultDimension, 'CAT');
dimAttr = DimensionAttribute::findByName('CAT');
dimAttrValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr, dimAttrCCValue, false, true);
if (dimAttrValue)
{
    dimavss.addItem(dimAttrValue);
}
/***********************************************************************/
dimAttrCCValue = CfzSalesOrderDataProvider::getDimensionDisplayValue(retailChannelTbl.DefaultDimension, 'RC');
dimAttr = DimensionAttribute::findByName('RC');
dimAttrValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr, dimAttrCCValue, false, true);
if (dimAttrValue)
{
    dimavss.addItem(dimAttrValue);
}
salesLine.DefaultDimension = dimavss.save();

and the body of the function getDimensionDisplayValue is below 

public static str getDimensionDisplayValue(RecId defaultDimension, Name dimName)
{
    DimensionAttributeValueSetStorage dimStorage;
    dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);
    return dimStorage.getDisplayValueByDimensionAttribute(DimensionAttribute::findByName(dimName).RecId);
}

  • Martin Dráb Profile Picture
    Martin Dráb 230,853 Most Valuable Professional on at
    RE: Unable to return DimensionAttributeValue record as no record exists in DimensionFinancialTag

    The problem is related to data in database, therefore the answer to "why this message didn't occurs on DEV environment" looks simple: because you have different data there.

    You didn't answer my question about the value. What value do you you pass to getDimensionDisplayValue() (= which value do you have retailChannelTbl.DefaultDimension)? Do you have such a value in DimensionFinancialTag table?

    I moved the thread from Dynamics AX Forum to Dynamics 365 Finance Forum. I also fixed the indentation for you - please pay more attention to it next time.

  • Ch Abdul Ahad Profile Picture
    Ch Abdul Ahad 5 on at
    RE: Unable to return DimensionAttributeValue record as no record exists in DimensionFinancialTag

    Hello Martin, Thanks for reply. The F&O version for UAT(Sandbox) environment is 10.0.30  and for DEV environment 10.0.27

    The line number 5 in first code snippet throw the error. which is below:

    dimAttrCCValue = CfzSalesOrderDataProvider::getDimensionDisplayValue(retailChannelTbl.DefaultDimension, 'CC');

    and yes that is the message I got in UAT(Sandbox) environment. But the thing if something is wrong than why this message didn't occurs on DEV environment.

    Code indent is mistakenly done, apologize.

  • Martin Dráb Profile Picture
    Martin Dráb 230,853 Most Valuable Professional on at
    RE: How to fix this error Unable to return DimensionAttributeValue record for Dimension CC with value as no record exists in table DimensionFinancialTag through view DimensionFinancialTag

    Which version is it about? It seems to be either AX 2012 or F&O.

    Which line of code does throw the error? What value are you looking for? Isn't the message right when saying that no such a record exists in DimensionFinancialTag table?

    By the way, is it really needed to indent code in your first snippet by 36 spaces?

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,996 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,853 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans