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)

Concatenate two or more fields into one field?

(1) ShareShare
ReportReport
Posted on by 45

Hi,

I have a question

There is a table contains two fields one is string and other is integer. Now i need to concatenate these two fields to one to get the third field. Is there any possibility in getting? how?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Zain Bokhari Profile Picture
    3,208 Moderator on at

    If you want to concatenate the fields through code you can do it in many ways,

    Like strfmt("%1%2", table.value1, table.value2 ); it will return a string with both values concatenated.

    Or str result = table.value1 + any2str(table.value2);

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Go one step back from Zain's post. There are multiple things to consider here.

    First of all, do you want to just show the field on a form without the requiremetns of searching/filtering?

    In that case you could write a display method on the Table, where you may use the code above to concatenate them, then add the display method on your form to just show the data.

    If you want to have the field physically in your database, then you need to change the metadata to add the new field, and then possibly an update job which populates it. If you want to maintain the value when any of the source fields change, you also need to do additional logic in the modifiedField/update methods.

    The third option would be to use a View with a computed column, where the data would again be filterable, and you could join this new view on your form to the original records.

    In any case, please contact your more experienced developers to work it out. Also you could use the search to find what to do in the MSDN documentation and blogs, since these are pretty basic/common tasks to do.

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