web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

caching issue d365fo

(0) ShareShare
ReportReport
Posted on by 232
Hi,

Is there any reason that getting financial dimensions in this way that would cause caching issue?
private DimensionValue getDimensionAttributeValue(Name _name, DimensionDefault _dimensionDefault)
{
    DefaultDimensionView defaultDimensionView;

    select firstonly DisplayValue from defaultDimensionView
        where defaultDimensionView.DefaultDimension == _dimensionDefault
         && defaultDimensionView.Name == _name;
 
    return defaultDimensionView.DisplayValue;
}


 private Name getDimensionAttributeValueDescription(Name _name, DimensionDisplayValue _dimAttrValue)
 {
     DimensionAttribute dimAttribute;
     DimensionAttributeValue dimAttributeValue;
 
     dimAttribute = DimensionAttribute::findByName(_name);
     dimAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttribute, _dimAttrValue);
 
     return dimAttributeValue.getName();
 }



We have a case, where when we click a button (Item requirements form), we send a business event. Then the integration calls a custom service to get more details. And they say the financial dimension is empty, they have to click the button more than one time where suddenly the values start appearing (it doesn't happen all the time) But they say they are sure that the financial dimension existed in the project from before

logic in custom service like this

select firstonly salesTable
    where salesTable.SalesId == _request.parmSaleOrderId()
outer join projTable
    where  salesTable.ProjId == projTable.ProjId;



 _contract1.ActivityDimension(this.getDimensionAttributeValue("@SYS1434", projTable.DefaultDimension));
 _contract1.ActivityDimensionDescription(this.getDimensionAttributeValueDescription("@SYS1434", _contract1.ActivityDimension()));
Categories:
I have the same question (0)
  • Suggested answer
    Subra Profile Picture
    1,288 on at
    Hi @CU22120935-0

    Could you please let us know whether you are getting the dimension values always second time when you click the button and I hope there will be no cache issue with this approach.

    Did you debugged and checked why the value is not coming for the first time and it's coming for second time?
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • CU22120935-0 Profile Picture
    232 on at
     
    we can't reproduce it. It happens in PROD randomly (and not frequently). But they are saying that when it happens, they click the button 2 or 3 times and it works.
  • André Arnaud de Calavon Profile Picture
    305,751 Super User 2026 Season 1 on at
    Hi,

    You are using a label to find the name of the attribute. In case the language of the running user is different, the value you send in the query will try to find another dimension.  This might be your culprit. I suggest to replace this with a value that can be configured on a parameter form.
  • Subra Profile Picture
    1,288 on at
    Hi @CU22120935-0

    Do we have the same issue for all the users in the Prod and why you are you not able to replicate the issue in other environments?

    @André Arnaud de Calavon If the issue is related to Label then it's should not for all the time correct? Did I'm missing anything here?
     
    Thanks,
    Subra
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 564 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 503 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 421

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans