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

How to use data entity to update existing records in a table ?

(0) ShareShare
ReportReport
Posted on by 18

Hi all

This development is for D365 F&O, I am using visual studio 2019 for the coding/development.

I have added a few customized fields in CustTable using extensions.

My requirement is to create a new data entity that will update the existing records. The user wants to import using excel, which will have customer account and the data for the custom fields.

Can someone please help me with this?

What I want to know is which methods do I need to override to complete my requirements also please do guide me to any standard entity with these methods.

Thank you all for your help in advance.

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    297,830 Super User 2025 Season 2 on at
    RE: How to use data entity to update existing records in a table ?

    Hi Anand,

    When a customer specifies requirement, then it is up to the partner/solution architect to correct them when they are against the best practices. There is no requirement to create a new data entity to be able to import the new fields. The existing one can be extended like mentioned above.

    Of course, you can create a new data entity, but you can easily make a mistake and end up with errors like you have now. We don't know the exact contents of the entity you have now, so we don't know what might cause the issue now.

    My suggestion is to extend the current entity with the new fields. You can then map the Excel columns with the target fields and start an import project. Please help the customer by informing them how the standard can be extended. A customer can tell you the business requirement, but you have to help them with the best technical implementation.

  • AnandKrishna Profile Picture
    18 on at
    RE: How to use data entity to update existing records in a table ?

    I duplicated the entity (CustCustomerV3) kept the required fields along with my customized fields, now when I try to import to update existing record I get the error "Cannot create a record in Customers (CustTable).

    The record already exists."

    The requirement specifically states that they need a separate data entity so adding my custom fields to standard entity is not an option.

  • Verified answer
    Deepak Agarwal Profile Picture
    8,585 on at
    RE: How to use data entity to update existing records in a table ?

    Hello,

    I agree with Girish, you don't need a new entity even if you want to update few fields. Pl understand the concept of data entity and how it works. Entity should have primary key to identify if its a new record or modification. For your requirement you can still use std entity with your changes and in excel template you can just keep those fields which you want along with mandatory fields.

    You can start exploring by removing few fields from std and try to import.

  • AnandKrishna Profile Picture
    18 on at
    RE: How to use data entity to update existing records in a table ?

    Thank you for the reply, Girish.

    I am aware I can extend the existing entity, but the customer has specified that they need a new entity for the newly added fields.

    Hence the post.

    The newly added entity is to just to update the existing customers and should not create anything new.

  • Verified answer
    GirishS Profile Picture
    27,825 Moderator on at
    RE: How to use data entity to update existing records in a table ?

    Hi AnandKrishna,

    If you have added new field to CustTable. You can extend the standard entity which is using this table and add your custom fields there. No need to create a new entity.

    Refer to the below link.

    https://d365ffo.com/2021/05/06/d365ffo-ax-add-new-field-to-a-data-entity/

    If you want to populate values to custom fields, you can make use of insertEntityDataSource methods. Refer to the below url for data entity method call sequence.

    https://axatoz.wordpress.com/2019/03/10/d365-data-entity-sequence/

    Thanks,

    Girish S.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 841 User Group Leader

#2
André Arnaud de Calavon Profile Picture

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

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 566

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans