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, ...
Answered

Reference for SysComputedColumn

(0) ShareShare
ReportReport
Posted on by

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,

I have the same question (0)
  • Verified answer
    Blue Wang Profile Picture
    on at

    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.

  • Verified answer
    Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    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.

  • Community Member Profile Picture
    on at

    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

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

    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.

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 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans