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, ...
Answered

How to add financial dimension in new released product form

(0) ShareShare
ReportReport
Posted on by 577

I've tried to add dimension entry no ds in EcoResProductCreate form and add following code in post init/OnPostRun, and dimension entry is not shown.

However, dimension entry is shown in newly created form.

DimensionEntryControl dimensionEntryValues;
dimensionEntryValues = formRun.design().controlName("DimensionEntryControlNoDS");
dimensionEntryValues.parmNonActiveValueErrorTolerance(ErrorTolerance::Error);
dimensionEntryValues.parmDisplayValues(true);
dimensionEntryValues.reactivate();
dimensionEntryValues.loadAttributeValueSet(22565463051);

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Tony,

    Can you share the full details of what you have done? This seems to be just a few lines of coding, but we can't see where you added this. Which class and method is having this coding?

    What are the differences between your new form and the EcoResProductCreate form? Does your new form has a datasource or not?

  • huijij Profile Picture
    19,811 on at

    Hi Tony,

    Did you try to add the logic in the method init() of the form?

    For the code you showed should be executed after the form is created.

    regards

  • Tony Mok Profile Picture
    577 on at

    Hi André Arnaud de Calavon,

    I added the code in Post_init of EcoResProductCreate form as below,

    [PostHandlerFor(formStr(EcoResProductCreate), formMethodStr(EcoResProductCreate, init))]
        public static void EcoResProductCreate_Post_init(XppPrePostArgs args)
        {
            FormRun                 fr = args.getThis();        
            
            DimensionEntryControl dimensionEntryValues;
            dimensionEntryValues = fr.design().controlName("DimensionEntryControlNoDS");
            dimensionEntryValues.parmNonActiveValueErrorTolerance(ErrorTolerance::Error);
            dimensionEntryValues.parmDisplayValues(true);
            dimensionEntryValues.reactivate();
        }

    Dimension entry no DS in the form extension EcoResProductCreate and the controller class is LedgerDefaultDimensionEntryController

    pastedimage1625470770581v1.png

    I added the code in Post_init of newly created from as below,

    [PostHandlerFor(formStr(newForm), formMethodStr(newForm, init))]
        public static void newForm_Post_init(XppPrePostArgs args)
        {
            FormRun                 fr = args.getThis();        
            
            DimensionEntryControl dimensionEntryValues;
            dimensionEntryValues = fr.design().controlName("DimensionEntryControlNoDS");
            dimensionEntryValues.parmNonActiveValueErrorTolerance(ErrorTolerance::Error);
            dimensionEntryValues.parmDisplayValues(true);
            dimensionEntryValues.reactivate();
        }

    Dimension entry no DS in the newly created form and the controller class is LedgerDefaultDimensionEntryController

    pastedimage1625470713003v1.png

  • Tony Mok Profile Picture
    577 on at

    Hi Judy,

    I've added the code in EcoResProductCreate_Post_init and dimension entry is not shown but the it is shown in newly created form.

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Tony,

    I do suspect there is a small difference. Did you add the dimension entry control as extension on your new form like the released products? Have you used the debugger to check what is happening in detail? Have you also tried it using a Chain of Commands instead if the post handler?

  • Tony Mok Profile Picture
    577 on at

    André Arnaud de Calavon,

    It should be the same. And, finally, form parts is solved.

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Tony,

    Thanks for your update. It is solved now? If so, can you tell what changes you made to make it work for you?

  • Verified answer
    salmanhafeez Profile Picture
    55 on at

    I did the same by adding formpart it is showing but how can i get the value of dimension from formpart on OK of ecoresproductcreate form.

  • Tony Mok Profile Picture
    577 on at

    Hi André Arnaud de Calavon,

    I cannot mark my answer. Form parts is solved.

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 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans