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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Auto populate Segmented Entry Control from customer default dimension.

(0) ShareShare
ReportReport
Posted on by 15

Hi Guys, 

I am using the segmented entry control on my custom form which is working fine, Now I want to Auto populate dimensions from the customer default dimension when the user selects the Main account in control.

which method to override? Or how to populate the other dimension from the customer when the main account is Changed.

I have the same question (0)
  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at

    Hi Kiran,

    To achieve this you will need to merge the current record LedgerDimension with the customer DefaultDimension right after the Main Account is modified.

    To handle the Main Account modification event you will need to override the onSegmentChanged() method on your segmented entry control.

    Here is a sample code:

    [Form]
    public class MyForm extends FormRun
    {
        DimensionAttributeRecId mainAccountDimAttr;
        
        public void init()
        {
            mainAccountDimAttr = DimensionAttribute::getWellKnownDimensionAttribute(DimensionAttributeType::MainAccount);
            
            super();
        }
        
        [Control("SegmentedEntry")]
        class Record_AccountNum
        {
            public void onSegmentChanged(DimensionControlSegment _segment)
            {
                super(_segment);
                
                if (_segment.parmDimensionAttribute().RecId == mainAccountDimAttr)
                {
                    record.LedgerDimension = DimensionDefaultingService::serviceCreateLedgerDimension(record.LedgerDimension, record.custTable().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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans