Announcements
No record found.
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
Can you add some details, it is not clear what are you trying to do ?
i need to add main account value by default when i create new line in service order
If you are talking about ledger Dimensions
ledgerDimension = AxdDimensionUtil::getLedgerAccountId('YOur account number');
i need to automatic pass the value in a certain form so how can i call it on the form??
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.
i added ledgerdimension but it doesnt show in the form itself as the main account value is blank in the line
can you share more details ? its hard to understand what are you doing without code or screenshots..
the highlighted line is blank as shown above which i add value in initvalue of SmaserviceOrderlineDS.please help.
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.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Joris dG 5
Sagar Suman 2 Super User 2026 Season 1
Alexey Lekanov 2