Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to fill a control value based on the modification of another control?

(0) ShareShare
ReportReport
Posted on by 1,550
Hi,
 
if let's say we have two controls, control1 and control2... how can we fill control2 based on modification of control1?
currently the word /hi/ is not being filled in control2 when i modify control1, why?
[Form]public class Form1 extends FormRun{    [Control(/String/)]    class control1    {        /// <summary>        ///        /// </summary>        /// <returns></returns>        public boolean modified()        {            boolean ret;                    ret = super();            if(ret)            {               Control2.text(/hi/);            }                    return ret;        }    }
 
  • Suggested answer
    Waed Ayyad Profile Picture
    7,968 Super User 2025 Season 1 on at
    How to fill a control value based on the modification of another control?
    Hi 
     
    You Can add your code on form Control (override modified field), or DataSource level by overriding Modified field method, or on Table level. It depends on the logic that you want to apply.
     
    Regards,
    Waed
     
     
  • Suggested answer
    Martin Dráb Profile Picture
    232,183 Most Valuable Professional on at
    How to fill a control value based on the modification of another control?
    Then forget individual controls and focus on data sources.
     
    Also, is the logic specific to this single form or should it happen in all cases? If the latter, don't put it on the form at all - put it on the table itself, such as to modifiedField() method.
  • junior AX Profile Picture
    1,550 on at
    How to fill a control value based on the modification of another control?
    Hi Martin,
     
    Yes bound to a datasource and it's the same data source for both
  • Martin Dráb Profile Picture
    232,183 Most Valuable Professional on at
    How to fill a control value based on the modification of another control?
    Are the controls bounds to a data source? You code assumes that they aren't - and the assumption may be wrong.
     
    And is it the same data source or two different ones?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,311 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,183 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans