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

Can i add virtual fields to views?

(0) ShareShare
ReportReport
Posted on by 1,552

Hi,

I noticed that there is a postLoad method in views but when you add a field to the view, you only get computed option and you can't decide if it's computed or not like in entities.

So is it doable to add a virtual field in views?

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi junior AX,

    Could you please explain your requirement? We can only add computed columns only in a view.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Junior AX,

    In views you can only use the computed columns based on T-SQL as it will create a view on SQL server to interact with the data.

    You can learn more here: docs.microsoft.com/.../walkthrough-add-a-computed-column-to-a-view

  • Blue Wang Profile Picture
    on at

    Hi JuniorAX,

    As mentioned, you cannot use virtual field in views. But it can be used on data entity.

    Use computed field and display method.

    72720.PNG

    https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/data-entity-computed-columns-virtual-fields

  • junior AX Profile Picture
    1,552 on at

    Hi Andre, Gunjan and Blue

    The problem is that i made an entity and put a complex range using computed method that represents the following:

    if (
            ((Id2 == A || Id2 == C)  && computedColumnId1 == null)
            || 
            (
                (Id2 == B && ComputedColumnId2 == A) 
                || (Id2 == D && ComputedColumnId2 == E))
            )
       )

    Now i want to add another OR to the range that says if  "Id2= X && virtual field = value

    this virtual field is why i asked the question. I know i can't add computed columns or virtual fields made in the entity inside the range method of the entity. But if i add a computed column in the view, then i can use it inside the range method ( just like i did for computedColumnId1 and computedColumnId2 shown above)

    But to be able to get the value of this virtual field, i need to write multiple select statements that i don't think i can do in computed column. Is there a way that i can write x code in view to fill a virtual field. If not what should i do to add this new range to the entity?

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

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 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