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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Read values from Dynamic form controls in D365FO

(1) ShareShare
ReportReport
Posted on by 409
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
 
I have the same question (0)
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 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,039 Super User 2025 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
    301,231 Super User 2025 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,039 Super User 2025 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,039 Super User 2025 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

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans