Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to add financial d...
Finance forum
Answered

How to add financial dimension in new released product form

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);

  • Tony Mok Profile Picture
    Tony Mok 577 on at
    RE: How to add financial dimension in new released product form

    Hi André Arnaud de Calavon,

    I cannot mark my answer. Form parts is solved.

  • Verified answer
    salmanhafeez Profile Picture
    salmanhafeez 55 on at
    RE: How to add financial dimension in new released product form

    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.

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,459 Super User on at
    RE: How to add financial dimension in new released product form

    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?

  • Tony Mok Profile Picture
    Tony Mok 577 on at
    RE: How to add financial dimension in new released product form

    André Arnaud de Calavon,

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

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,459 Super User on at
    RE: How to add financial dimension in new released product form

    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
    Tony Mok 577 on at
    RE: How to add financial dimension in new released product form

    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.

  • Tony Mok Profile Picture
    Tony Mok 577 on at
    RE: How to add financial dimension in new released product form

    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

  • huijij Profile Picture
    huijij 19,803 on at
    RE: How to add financial dimension in new released product form

    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

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 288,459 Super User on at
    RE: How to add financial dimension in new released product form

    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?

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans