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

View Computed Column to display value

(0) ShareShare
ReportReport
Posted on by 124

Hello everyone,

I have one requirement, i am creating one view. And I want to show some values in view's computed column with the help of methods which I have to create on view. 

I have to use multiple join conditions on view methods. But on view methods have to be static methods. So I am not able to use "this" keyword. 

Eg: on view i have itemId field, now with the use of that item Id field I have to display some other values from other table.

So how can I get that current value in my methods,as we cannot use this keyword.

I have the same question (0)
  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    The purpose of a computed column method is generating a piece of T-SQL to be injected to the view definition of database synchronization. Refering to a particular record of the view makes no sense there. So you seem to be trying a wrong thing.

    If you explain your business requirement to us, we'll likely be able to suggest a technical solution that can actually work.

  • D365_FO_Technical_Te Profile Picture
    124 on at

    I am using view. In view i have multiple fields coming from different DS. But I want to show some more fields on view which are not present in current Datasources of view. So for that I want to use display method on view to show records on those unbounded columns also. So I was trying to use computed columns and trying to use viewmethod property on that. But the problem is I want to show that computed column with respect to current record's field.

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

    What you're describing is not the problem that business users want to address. You're describing your technical design - and we already know that is wrong and can't be used. Display methods are used to directly obtain values, not to generate T-SQL code, therefore trying to use them in computed columns is impossible.

    Either use display methods and forget computed columns, or use computed columns, but then you can't use your display methods there. You would have to rewrite them to T-SQL, if it's possible at all.

    What you need to do is throwing away your design and look at the actual business requirements. Only when you know what users need, you can start designing a technical solution.

    For example, if users want to see the view (and the calculated values) in a form, consider if filtering and sorting by them is needed. If not, you can simply use display methods (after taking perfomance into account). If not, using computed columns may be a solution, if the logic can be written in T-SQL (e.g. it doesn't depend on X++ classes). But that's not the only way. For example, you could use a temporary table and put results of display methods to this table.

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