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 ?
Hi Zohan,
You can try SysSomputedColumn::addList. You can check this example from PayrollPayStatementEarningLineInquiryEntity -
private static str formatCompensationPlanAndOption() { List planOptionList = new List(Types::String); planOptionList.addEnd(SysComputedColumn::returnField(tableStr(PayrollPayStatementEarningLineInquiryEntity), dataEntityDataSourceStr(PayrollPayStatementEarningLineInquiryEntity, HcmBenefitPlanComp), fieldStr(HcmBenefitPlan, BenefitPlanID))); planOptionList.addEnd(SysComputedColumn::returnLiteral(' ')); planOptionList.addEnd(SysComputedColumn::returnField(tableStr(PayrollPayStatementEarningLineInquiryEntity), dataEntityDataSourceStr(PayrollPayStatementEarningLineInquiryEntity, HcmBenefitOptionComp), fieldStr(HcmBenefitOption, BenefitOptionID))); return SysComputedColumn::addList(planOptionList); }
the add functionality accepts only two arguments. i've to write my own custom method for this ? i guess
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.
You can try using SysComputedColumn::returnLiteral -
SysComputedColumn::returnLiteral("-"),
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
Adding string fields is equivalent to concatenating them. Did try writing a method for the computed field this way?
What's the difference?
Hi Gunjan, I need to concatenate two string fields. not adding them
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)
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)) ); }
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Sohaib Cheema 823 User Group Leader
André Arnaud de Cal... 673 Super User 2025 Season 2
Martin Dráb 491 Most Valuable Professional