Notifications
Announcements
No record found.
Hello all,
I cannot find Microsoft docs on SysComputedColumn functions will all the function and explanation (and maybe a clear sample). Can anyone help ?
I only can find this : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/data-entity-computed-columns-virtual-fields
Actually, I'm trying to understand the different between SysComputedColumn::ReturnField and SysComputedColumn::ComparisonField. They both having same parameter and to me will return the same thing.
Hope I can have clearer view on this.
Thanks,
Hi WWwong,
Please check SysComputedColumn class:docs.microsoft.com/.../gg945162(v=ax.60)
::comparisonField Creates a field expression to use for comparison with other fields or literals.
When you use Equal or not Equal, you need this.
::returnField Creates a field expression to use for returning a value.
The methods written for computed column computation should be declared as static and in order to access a field we need to use SysComputedColumn::returnField() method.
Documentation offers the following: Walkthrough: Add a Computed Column to a View.
But it doesn't explain much; look for details in blog posts instead. For example:
Regarding returnFiel() vs comparisonFieldI(), we can see their implementation but all they do is calling dictView.computedColumnString() (with different values of the third parameter) and we can't easily review code of DictView. I assume the methods return the same thing in most situations, but there are special cases when it's not true.
Hi Martin,
So let me get conclusion, if we want to have a calculation later in the same Computed column, lets say, Substract or getDateDiff, we need to use "comparisonField", whereas if we just want to display a value, then we will use "returnField"
can I say that ?
Thanks
It depends on where you want to use the function. If on a value you'll return, use returnField(), if on a value you compare with, use comparisonField().
You'll find examples of both cases in the standard application. For example, EntAssetWorkOrderView uses getDateDiff() with comparisonField() while CustCollectionsBIActivitiesAverageCloseTime users returnField().
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 Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 646 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader