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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Dynamics NAVAX / Referencing a form control ...

Referencing a form control [AX7]

Munib Profile Picture Munib 2,500

I am seeing this a lot more these days because of extensions in AX7. You tend to take the form run in the event and try to get a form control.

A lot of developers seem to be hard coding the control name. Not wrong but not the best way to do it. A form control name could change or be deleted. Then you wont catch this until a user runs it.

Not so good way:

formRun.design().controlName(“MyControlName”)

formRun.design().controlName(identifierStr(MyControlName));

The right way:

formRun.design().controlName(formControlStr(MyFormName, MyControlName));

This way you get your errors during compile time.


This was originally posted here.

Comments

*This post is locked for comments