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, ...
Suggested Answer

Read values from Dynamic form controls in D365FO

(1) ShareShare
ReportReport
Posted on by 488
Hello,
I need to read the value from a dynamically added form control on button click event. 
Specifically, I need to read values of the custGroup field on create new customer form on clicked event of the Save button. The regular code will not work here because the control names are not identified
 
  • Suggested answer
    Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,
     
    In the event handler code of clicked button, you can't directly get the value of control. You should call it as in the following code:
    FormRun formRun = sender.formRun();
    FormStringControl custGroup= formRun.design().controlName(formControlStr(FormName, ControlName)) as
    ​​​​​​​ FormStringControl; info(custGroup.valuestr());
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
     
  • Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • André Arnaud de Calavon Profile Picture
    307,704 Super User 2026 Season 2 on at
    Hi Srikanth,

    The control you marked is bound to a DataSource field. You can get the value from the DirPartyEntity (CustTable) datasource, field CustGroup. When initializing the form, the datasource table is replaced with CustTable and the fields displayed are coming from field groups.
  • Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 511 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 426 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 159

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans