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

Concatenate two or more fields in computed column in view D365fo

(0) ShareShare
ReportReport
Posted on by 199

Hi All,

I've a scenario where i've to concatenate two or more fields on computed column of view. How would it be possible. Any suggestion ? 

I have the same question (0)
  • Suggested answer
    vinitgoyal2005 Profile Picture
    6,332 on at

    Hi,

    Look at MS Docs, the example given is of concatenation:  

    docs.microsoft.com/.../walkthrough-add-a-computed-column-to-a-view

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Zohan 93,

    You can use SysComputedColumn::add. Please check the sample code below -

    public static server str stingConcatenate()
    {
        return SysComputedColumn::add(SysComputedColumn::returnField(tableStr(View1), identifierStr(table_1), fieldStr(table1, Field1)),
                                      SysComputedColumn::returnField(tableStr(View1), identifierStr(table_1), fieldStr(table1, Field2))
                                      );
    }

  • Blue Wang Profile Picture
    on at

    Hi Zohan,

    Here is a share:community.dynamics.com/.../how-to-concatenate-two-fields-get-from-view-with-hyphen

    More about SysComputedColumn: docs.microsoft.com/.../gg945162(v=ax.60)

  • Zohan_93 Profile Picture
    199 on at

    Hi Gunjan, I need to concatenate two string fields. not adding them

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    What's the difference?

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Zohan,

    Adding string fields is equivalent to concatenating them. Did try writing a method for the computed field this way?

  • Zohan_93 Profile Picture
    199 on at

    Yes I've tried it but when ever i tried to use the keyword hyphen "|", it throws an error on build.

    Anyhow i've tried Concat keyword but this shows me in this format, need to add hyphen after dimension change

    below is my result i'm getting using Concat:

    Branch20Department65MainAccount511301Segment54BusinessUnit02

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    You can try using SysComputedColumn::returnLiteral -

    SysComputedColumn::returnLiteral("-"),
    

  • Suggested answer
    Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Do you have any particular reason to implement your own solution for dimensions instead of using the standard one? You can check LedgerJournalLineEntity, for example.

    Anyway, the result seems to be what you asked for. If you want to add a delimiter, you could utilize CONCAT_WS() instead of CONCAT(). But you shouldn't - you should use the standard solution, which also respect the standard separator defined in parameters.

  • Zohan_93 Profile Picture
    199 on at

    the add functionality accepts only two arguments. i've to write my own custom method for this ? i guess

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
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans