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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Best way to access a formControl (from FormRun or FormDesign) and possible pros and cons

(1) ShareShare
ReportReport
Posted on by 14
Hi to all,
 
while browsing and looking for solutions to other problems, I noticed that there is no consensus or a general rule for how to access a formControl on a form.
I have seen solutions like the followings, all basically achieving the same:
 
FormControl  frControl;
FormControl  fdControl;
 
FormRun        fr           = this.formRun();
FormDesign   fd          = this.formRun().design();
str                  cName  = formControlStr(MyForm, MyControl);
 
frControl  = fr.control(fr.controlId(cName));
fdControl = fd.controlName(cName);
 
(Sorry, code looks ugly, but I don't understand how to make it work, markup language or other or mixed font usage do not work...) 
What I wrote above might not be 100% syntax correct, depending if we are trying to get a control from a Handler, in a form extension or other, but the point is:
 
You can access a control on the form both from the FormRun or FormDesign class.
So here my question: is there a preferred solution? If so why?
And if there is not a clear preference, what are possible pros and cons of the two approaches, when making the choice?
 
I remember something like a form can have multiple designs so accessing through the FormDesign is not 100% safe, but I am not sure if it is something I read or just a false memory. I cannot find anything that helps me sort this doubt.
Thanks to all!
 
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans