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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Updating financial dimension in D365FO in from through x++

(3) ShareShare
ReportReport
Posted on by 3,008
tiHi Team,
 
Expense management -> expense reports -> new expense report.
 
While creating new expense report, financial dimensions are automatically coming from employee setup. We need to update one of the custom financial dimension 'Funding_type' to some value while creating new expense report, which will be configured in parameters form part of customization instead of employee setup.
 
Could you please assist here x++ coding wise.
 
Find below screenshot for reference.
 
 
Thanks in advance,
Krishna.
Categories:
I have the same question (0)
  • Adis Profile Picture
    6,597 Super User 2026 Season 1 on at
    Hello,
     
    I am not a developer, so I cant assist you, however, no one can paste you the exact code as no one knows the configuration in parameters form you mentioned.
     
     
    What would help others in order to help you is to tell us what you have so far and at which point you are stuck.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

  • Verified answer
    Martin Dráb Profile Picture
    239,035 Most Valuable Professional on at
    Use DimensionAttributeValueSetStorage class to manipulate default dimensions. For example:
    // Load dimensions to the the storage class (based on a table field)
    DimensionAttributeValueSetStorage dimStorage = DimensionAttributeValueSetStorage::find(yourTable.DefaultDimension); 
    
    // Get the dimension attribute
    DimensionAttribute dimAttr = DimensionAttribute::findByName(...);
    
    // Find or create the dimension value record
    DimensionAttributeValue dimValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimAttr, 'New value' , false, true);
    
    // Assign the new value to the dimension set
    dimStorage.addItem(dimValue);
    
    // Generate a new ID of the dimension set and assing it to the table field
    yourTable.DefaultDimension = dimStorage.save();
     
  • krishna.rao@dax Profile Picture
    3,008 on at
    Thanks Team responses so far.
     
     
    I have raised this thread to assist on how to write code. as it's bit different, Already debugged , this is not straight forward ..
  • André Arnaud de Calavon Profile Picture
    303,714 Super User 2026 Season 1 on at
    Hi Krishna,

    Can you tell us if the reply from Martin is helpful for you? It explains how to interact with the dimensions. You only need to implement it for the correct dimension in your environment. What exact coding did you use? What was the debugger outcome? 
  • krishna.rao@dax Profile Picture
    3,008 on at
    Hi Andre,
     
    It looks like working I need to do further tests and will update here.
     
    Thanks so much for prompt response Martin and  everyone on this..
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans