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

elemento.control and element.design

(0) ShareShare
ReportReport
Posted on by

Hello,


I have one control HTML named reportHTML in my Form (FormReporte)

what is the best way to access


1. element.control(element.controlId(formControlStr(FormReporte, reporteHTML)))

2. element.design().control(element.controlId("reporteHTML"));

3. element.control(control::reporteHTML);

4. element.design().control(Control::reporteHTML);

I have AX 2012

Thank you

*This post is locked for comments

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

    Set auto declaration property on the control to "true" and use it by name like:

    reporteHTML.allowEdit(false);


    It is the shortest way. Never use element.design().control(element.controlId("reporteHTML")); because it relays on hardcoded value and will throw runtime error if control will be renamed.

  • Community Member Profile Picture
    on at

    Hi , but recommends the following link not use AutoDeclaration

    dynamicsaxspace.com/.../how-to-refer-to-form-controls-in-code-without-setting-the-autodeclaration-property-in-dynamics-ax

  • Mea_ Profile Picture
    60,284 on at

    First of all that blog posts says that he is not recommending to use this property on existing items because he thinks that it is not clear what was modified. I don't think so because you will see that form is customized and then you will do compare and in compare you will see all the changes, irrespective what it was.

    However FormReporte looks like a custom form so it is not relevant.

    There is no difference at all you can use autoDeclaration or formControlStr, Its just a matter of taste, but. formControlStr involves more typing :)

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

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans