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 :
Supply chain | Supply Chain Management, Commerce
Suggested answer

Update data using DMF Data entity in X++

(0) ShareShare
ReportReport
Posted on by 10

Hi, How can we update data using data entity through x++codes. Can we achieve it?

I am using similar code as mentioned  in below sample:

 

CustCustomersV3Entity entity;

entity.selectforupdate(true);

entity.CustomerAccount = xyz;

entity.CustGroup = custgroup1;

ttsbegin;

entity.update();

ttscommit;

I have the same question (0)
  • junior AX Profile Picture
    1,552 on at
    RE: Update data using DMF Data entity in X++

    Hi Girish and Mohit,

    I saw this question and i got attracted by your replies.

    Do you both mean that, when we update the entity all nodes in the entity will be updated even if the change was specified in code was for one table only? I mean if the entity let's say have 5 tables joined together, a select for update will be called 5 times?

    And Mohit, when u said if data validation is skipped in data entity level but essential in table level. First how can this be skipped? And can you please give a real example to explain the issue..i mean what important validations we shouldn't skip in data entity level?

  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: Update data using DMF Data entity in X++

    Hey Girish, I'm not saying "Data entity cannot be used in the code for CRUD operation via code". It is possible to use it in CRUD operation but 'should' not be used unless there is very strong reason to do it. One reason you mentioned, It will consume more time to update the record. How about if table validation is skipped in Data entity level and essential in table level.

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: Update data using DMF Data entity in X++

    I think you cannot say "Data entity cannot be used in the code for CRUD operation via code.

    It can be used for CRUD operation when you are updating or inserting record from multiple tables.

    But in respective to the thread, you can say it's better to update the Cust Table as he only needs to update record only in Cust Table.

    Thanks,

    Girish S.

  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: Update data using DMF Data entity in X++

    Please use CustTable directly in your code. Data entity is to export/import tables data in a normalized view, should not be updated directly via code.

  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: Update data using DMF Data entity in X++

    It will be better to update customer data using CustTable instead of Data Entity. It will consume more time to update the record in the database as Entity will have more tables added as DataSource.

    Thanks,

    Girish S.

  • Pranav Sinha Profile Picture
    10 on at
    RE: Update data using DMF Data entity in X++

    I want to update it through code if customer already exists. So I am checking for possibility of it can be done using data entity or i will need to use table to update customer.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: Update data using DMF Data entity in X++

    Hi Pranav, You can try it but it is not a right approach. Do you want to update data entity only and not CustTable table? If not, then you can use excel-in to edit and publish the data which will update both CustCustomersV3Entity and CustTable or use Data project in Data management to import data 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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 367

#2
André Arnaud de Calavon Profile Picture

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

#3
Yng Lih Profile Picture

Yng Lih 149

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans