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 :
Microsoft Dynamics AX (Archived)

How to Concatinate multiple Form Control values into one new Control in the same Form.

(0) ShareShare
ReportReport
Posted on by 353

Hi -

  I have a form with multiple fields and display methods. I need to add a new control on the form which will display the concatenated value from other controls in the same form. Is this possible to do ?

for example

Capture22.JPG

I have a Control Account, Name and Dob. The new control is empty for now.  Is it possible that I can use the values from Account Name and Dob control and concatenate them and display it in my new Control something like this ?

63002.Capture.JPG

Thank You

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi Muhammad_Ali!

    If you want just to display concatenated value on the form you should use display method.

    If you want to store concatenated value in the new table's field - there are many ways to do it.

  • Muhammad_Ali Profile Picture
    353 on at

    Hi Rustem -

     I cannot use a display method on the table level because if I do then I cant access my control values from form through x++. ? Please correct me if I'm mistaken. Is there a way I can use the current values on the form itself and concatenate them into a new control on a same form.  Maybe a new method somewhere in a form itself? Datasource ? control method ?

    Thank You

  • Rustem Galiamov Profile Picture
    8,072 on at

    You wrote "new control on a same form" - is this control is the control from form data source table or just form control?

  • Muhammad_Ali Profile Picture
    353 on at

    It is just a form Control. Now I need to add a value to this control by concatenating the values from the other controls which are already on the form.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Create display method on form's DS and set this method as DataMethod property on your form control, also set DataSource property on your form control. 

    As example:

    display str getConcatinatedValue(YourDSTable _yourDSTable = YourDSTable)
    {
        return strFmt("%1 %2", _yourDSTable.Field1, _yourDSTable.Field2);
    }


  • Muhammad_Ali Profile Picture
    353 on at

    is it possible for me to use Multiple datasource tables on this method ?

    Because I have multiple Datasources on my form. And the values I need to concatenate are from 2 different data sources

    for example

    display str getConcatinatedValue(YourDSTable1 , YourDSTable2 )

    {

       return strFmt("%1 %2", _yourDSTable1.Field1, _yourDSTable2.Field2);

    }

    Thank You

  • Muhammad_Ali Profile Picture
    353 on at

    Just to clarify the values I'm trying to concatenate are through other display methods. These values are not present in a table(Data source). I have two display methods on two different controls which are getting the values for them. Now I need to concatenate these two values in a new control altogether. I hope I'm making sense.

    Thanks

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    To get values from another table or display methods you should get the records of another table which depends from first table and call logic from another display methods to get the values. And keep in mind what this will affect performance.

    Maybe the best way is to create a field on the table and fill it?

  • Muhammad_Ali Profile Picture
    353 on at

    ok that is an option I agree but I was thinking maybe if I can set the Auto Declaration property of a control to yes and use the value of that control on another control in the same form ? I need to know if this is possible ?

  • Rustem Galiamov Profile Picture
    8,072 on at

    Yes, you can try, of course. But any way, calling value from another control also will call logic from control's display method.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans