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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

ReadOnly data entity

(0) ShareShare
ReportReport
Posted on by 1,552

Hi,

If we want to import using DMF, does all entity datasources require to be is Read only No? Or some of them needs to be No?

What does this property do?

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    236,471 Most Valuable Professional on at
    RE: ReadOnly data entity

    The entity itself mustn't be read-only. Some of its data sources may be read-only.

  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: ReadOnly data entity

    Hi junior Ax

    I guess Readonly datasoure will be used for lookup purposes and cannot write data into that entity.

    Refer to the below Microsoft documentation.

    https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/behavioral-properties-data-entities

    Thanks

    Girish S.

  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    RE: ReadOnly data entity

    As the property name suggests if read only is yes means it only used for only export and cannot write into it. If read only is no means it can be written and read. So to ans your question it is based on the requirement. If you need to enter the data into all the datasources involved then you simply keep the read-only property to no. That's it.

  • junior AX Profile Picture
    1,552 on at
    RE: ReadOnly data entity

    Hi All,

    If let's say i have this

    Table1

    Name Number RecId (Name and Number unique)

    A            A1                   1

    B           B2                    2

    A          A3                     3

    Table2 (relation with table1 is recId)

    Field1       Table1RecId  Table2RecId (Field1 unique)

    F1                 1                          1

    F2                 1                          2

    F3                 2                          3

    Table3 (relation with table2 is recId)

    Table2RecId FieldX FieldY 

    1                      x           y

    1                       x         z

    2                      y          z

    (Table2RecId and FieldX and FieldY unique )

    If I create an Entity(Single) -- Entity Key (FieldX from table 3, FieldY from table3, Field1 from table2)

    Main datasource is table3      

    then table3 is inner joined with Table2

    and Table2 is inner joined with table1

    1) Now if i want to import in table3 and table2 but table1 already exists -- does that mean table1 should be read only?

    2) and if i want to import, shall i pass values of table1 as well even though it's ready only?

    3) is the entity key correct in this case?

  • Martin Dráb Profile Picture
    236,471 Most Valuable Professional on at
    RE: ReadOnly data entity

    1) If you don't want to import any data to it, therefore you consider it read-only, you should set it as read-only.

    2) Only the values that you need to identify references to the other tables. For example, if Number is the natural key of TableA, this is what you should use in your entity.

    3) I can't comment on it - it would require additional information.

  • junior AX Profile Picture
    1,552 on at
    RE: ReadOnly data entity

    Hi Martin,

    For you reply regarding point 2... Number field in table1 is int64. therefore I can't ask the user to import it.. but since it comes from a  read only datasource, can I somehow pass it by code based on the relation between table1 and table2 (based on the values imported from table2)? If yes, how? or what method shall I use?

    For point 3: is there certain info you need to know? As I described the fields, relation between the three tables and the unique index for each table?

  • Martin Dráb Profile Picture
    236,471 Most Valuable Professional on at
    RE: ReadOnly data entity

    2) So what is the the natural unique key of the Table1? Is Name guaranteed to be unique? If so, then use the Name. By the way, numeric fields can be set by users too; that's not a problem. But if it's a RecId, then yes, it can't be set by users. That's why I keep talking about natural keys.

    Regarding "can I somehow pass it by code based on the relation between table1 and table2 (based on the values imported from table2)": the relation needs to be identified by fields - that's exactly why we're now talking about which field to use to identify the record in TableA.

    3) No, you didn't even explain fields and keys, as discussed above. We don't know the purpose of those tables and fields (such as that the Number field can't be used for import), cardinality of relations, which fields are mandatory and so on.

    If you want to import data to Table1RecId (which I don't know), then you must have an entity field identifying Table1. But I can't say whether it must be in the entity key or not - it depends on your requirements.

  • junior AX Profile Picture
    1,552 on at
    RE: ReadOnly data entity

    Hi Martin,

    2) The Unique key for table1 is [Name (string) and Number (RecId)  what do you mean by natural key? does it mean "what's the unique key that is not a RecId", if yes, then it's the Name field. but the name alone is not unique in the table. So does that mean the Name alone from table1 should be one of the entity keys?

    3) Regarding "If you want to import data to Table1RecId (which I don't know), then you must have an entity field identifying Table1. But I can't say whether it must be in the entity key or not - it depends on your requirements."

    I want to Import to Table 2 and Table3. However, Table1 should be in the entity, so that we know that records from table2 and table3 belongs to a record in table1.
    That's why I asked, that in this case, Table1 should be read only because I'm not going to insert anything to it, but i need it look them together  -- based on what i understood from you
    And Table2 and Table3 ReadOnly property should be set to No because i need to import to them

    but how can I pass values of table1 without actually making the user fill them?


    This is more info about the table (unique keys of the table, data types of the fields, relation between tables)

    Table1 (Name and Number unique)
    
    Name(string) Number(int64)       Table1RecId(RecId) 
    
    A            A1                   1
    
    B            B2                   2
    
    A            A3                   3
    
    Table2 (Field1 unique)
    (relation with table1 is recId  --  Table2.Table1RecId = Table1.RecId) 
    Table1 - Table2 -- one to many
    
    Field1(string)       Table1RecId(RecId)           Table2RecId(RecId)
    
    F1                      1                            1
    
    F2                      1                            2
    
    F3                      2                            3
    
    Table3 (Table2RecId and FieldX and FieldY unique)
    (relation with table2 is recId  -- Table3.Table2RecId = Table2RecId)
    Table2 - Table3 is one to many
    
    Table2RecId(RecId)   FieldX(String)     FieldY(String) 
    
    1                         x                y
    
    1                         x                z
    
    2                         y                z

    3) I just need to understand how to specify Entity key when importing. I think your reply for point 1 will help me.

    3a. If table1 is read only, then does that mean that it doesn't need to be in the entity key?

    3b.shall the entity key only be from table2 and table3 because they are used for import?

    3c. When importing, the entity key shouldn't contain RecId?

    3d. based on the additional info -- what do you think they entity key should be in this case?

  • Martin Dráb Profile Picture
    236,471 Most Valuable Professional on at
    RE: ReadOnly data entity

    2) You're saying that your current data model doesn't allow using this table in an entity, because it would require users specifying the RecId. You need to change your data model before you can continue. The table needs a unique field, or a combination of fields, that users can use when defining data to import. That's the natural key. If none of the current fields can be used, create a new ID field, set it as an alternate key and use it in the entity.

    Using the Name alone isn't sufficient, because it doesn't uniquely identify a record.

    3a) No, whether it's readonly or not isn't relevant. Whether it should be in the entity key or it can be non-key field in the entity depends on your data model.

    3b) As above. You must have a field to identify Table1, but I can't tell you whether it seeds to be key of your entity. Ask yourself whether Table1RecId is necessary to identify a record in Table2. If so, does it make sense to create the entity without an identification of Table1 in the entity key?

    3c) Correct.

    3d) As above.

  • junior AX Profile Picture
    1,552 on at
    RE: ReadOnly data entity

    Hi Martin,

    2a. So Name and Number are unique fields in table1 and mandatory (you can think of number as the party which is recId)  

    Regarding this "You're saying that your current data model doesn't allow using this table in an entity, because it would require users specifying the RecId."  It's  more like I'm asking, is anything in the entity key means that the user should input them?

    2b. if i didn't put number field in the entity key but it's mandatory at the table level, then is the user still required to fill it?

    2c. If i'm going to import this customized entity by code, can't i say fill the Number field by code since i have the relation and i can get the number field without making the user fill it?

    2d. Regarding this: "If none of the current fields can be used, create a new ID field, set it as an alternate key and use it in the entity."  Do you mean i need to create a new unique field in the table? but what if the table is not made by me and it already contains data

    3a. Regarding this: "Whether it should be in the entity key or it can be non-key field in the entity depends on your data model" when you say it depends on your data model what do you mean? 

    3b. Table 2 belongs to table1, it's like table1 is header and table2 is lines, so Table2 needs to be linked with table1. So to answer your question: "Ask yourself whether Table1RecId is necessary to identify a record in Table2" Then yes. but how can i answer this question?? "If so, does it make sense to create the entity without an identification of Table1 in the entity key?"

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,964

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 564 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans