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 :
Microsoft Dynamics AX (Archived)

how to add default main account in financial dimension on Service management model AX

(0) ShareShare
ReportReport
Posted on by 10,280

please anybody tell me what class i use to add default main account value inside the form of service order AX 2012

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    Can you add some details, it is not clear what are you trying to do ?

  • Codehunter Profile Picture
    10,280 on at

    i need to add main account value by default when i create new line in service order

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    If you are talking about ledger Dimensions

    ledgerDimension = AxdDimensionUtil::getLedgerAccountId('YOur account number');

  • Codehunter Profile Picture
    10,280 on at

    i need to automatic pass the value in a certain form so how can i call it on the form??

  • Mea_ Profile Picture
    60,286 on at

    on the form data source you can override "initValue()" method of SMAServiceOrderLine ds and write something like

    SMAServiceOrderLine.ledgerDimension = AxdDimensionUtil::getLedgerAccountId('Your account number'); where "Your account number" = account you want to pass.

  • Codehunter Profile Picture
    10,280 on at

    i added ledgerdimension but it doesnt show in the form itself as the main account value is blank in the line

  • Mea_ Profile Picture
    60,286 on at

    can you share more details ? its hard to understand what are you doing without code or screenshots..

  • Codehunter Profile Picture
    10,280 on at

    1stphoto.jpg

  • Codehunter Profile Picture
    10,280 on at

    the highlighted line is blank as shown above which i add value in initvalue of SmaserviceOrderlineDS.please help.

  • Mea_ Profile Picture
    60,286 on at

    Because it is not ledger Dimensions it is DefaultDimensions.  

    Here you go

    DimensionAttributeValueSetStorage   valueSetStorage = new DimensionAttributeValueSetStorage();
    
     DimensionAttribute      dimensionAttribute = dimensionAttribute::findByName("Main_Account");
     DimensionAttributeValue dimensionAttributeValue = dimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, "Your account number",false,true);
    
    valueSetStorage.addItem(dimensionAttributeValue);
    
    defaultDimension = valueSetStorage.save();  

    Using this code you can create new DefaultDimension.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans