web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

get data from data entity

(2) ShareShare
ReportReport
Posted on by 150
Hi,

If I have an entity, and i want to get a field value from another table for export purposes

Would it be better to join to that table with Read only and add this field alone OR create a computed column to return the value of that field? is the performance the same?
I know computed column is more complex but what is better?
Categories:
I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    303,105 Super User 2026 Season 1 on at
    Hi,

    You can create virtual fields in two ways: 
    1.  X++ method and call postLoad() to fill the field values
    2.  T-SQL > X++ method for extending the SQL query
     
    If you are using the second option, or join a table, there is no difference in performance as all will be executed on SQL server. If you use the first option, then there will be a performance penalty.
  • CU22120935-0 Profile Picture
    150 on at
    Hi Andre,

    Yes my question was about computed columns (T-SQL) vs joins (not virtual field with postLoad)

    so if it's the same performance, i'm free to use whatever.
  • CU22120935-0 Profile Picture
    150 on at
    @André Arnaud de Calavon

    To add to my last reply. If i leave allow edit for the computed field as Auto or make it No, it would still be the same right?
    We can't edit computed columns anyways?
  • Verified answer
    Martin Dráb Profile Picture
    238,740 Most Valuable Professional on at
    I would prefer a join - it's less work and you can easily use multiple tables from the joined table.
    You can allow import to entity fields backed by computed columns. The value won't be stored anywhere, but you can write to do so.
  • CU22120935-0 Profile Picture
    150 on at
    Hi @Martin Dráb,

    I'm afraid i didn't understand this "You can allow import to entity fields backed by computed columns"
    Can you please explain with an example?
     
    And does it then matter if I make it allow Edit No or Auto?
  • André Arnaud de Calavon Profile Picture
    303,105 Super User 2026 Season 1 on at
    Hi,
     
    The property on the computed column is for export only not important. I think Martin wanted to mention that using joins it is easier to use the same field for import purposes. With a computed column, you need to write additional logic to be able to import the values.
  • Martin Dráb Profile Picture
    238,740 Most Valuable Professional on at
    An example is PartyType field of DirPartyBaseEntity. It's a computed column, but it explicitly allows setting a value on import. The value is then used in code, e.g. in preUpdatePartyBuffer() method.
  • CU22120935-0 Profile Picture
    150 on at
    Hi All, 
    @Martin Dráb @André Arnaud de Calavon

    I think what you are trying to say, that allowEdit yes, will allow me to change the computed column value when importing, so that based on that value i can decide few things but it won't be actually saved.

    But if allowEdit is false, even if change the value when importing, i want be able to see that new value in code

    Right?
  • André Arnaud de Calavon Profile Picture
    303,105 Super User 2026 Season 1 on at
    Hi,
     
    In case allowEdit is false, there will be a validation error. It is not common for having a requirement to see a changed value for a read-only field. It is impossible to change it or provide a changed value.
  • Anthony Blake Profile Picture
    3,061 Super User 2026 Season 1 on at
     
    For computed fields:
     
    Allow Edit = false You cannot write anything to this field via entity. It is read only. as @André Arnaud de Calavon's comment
    Allow Edit = true You can write to this via data entity, but it is not bound to a database field, so does nothing unless you write code to do something. For an example, see @Martin Dráb's DirPartyBase entity example, which is standard code so you can go take a look at how it works.
     
    Hope this helps.
    Anthony

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans