Hi
I have copied a data entity by using "Duplicate in project" in Visual Studio as I want to add a couple of fields to the standard data entity.
But now it won't Build as it is complaining that it cannot find the related tables or fields that make up the data entity.
Is there a step I have missed out?
Many thanks
Hi,
You need to check the original object`s model is referenced in yours. If not, update the model parameters.
Hi Chris,
Instead of duplicating the data entity, you can create a new model and new solution with a project where you can create an extension on top of the standard data entity. You are able to add fields using an extension.
As Andre suggested, you should extend the existing entity instead of duplicating it, if you want to add some fields.
Anyway remember to update your model parameters, adding reference to any packages that you use in your model. For example if you use a data type or table from packageX, your model/package must have a reference to it.
Hi Andre - yes I have a new model and a new solution / project but I was told it was "best practice" to create a new data entity as we can't be sure what Microsoft will do with their standard data entities moving forward. What do you think?
Hi Anitha - yes i checked that and it was, but doing a full build now so will see
Thanks Nikolaos - I understand that, but same question I asked Andre - is duplicating a data entity best practice as extension would definitely be easier!?
No, duplication is not the best practice. I would recommend extending unless you have a specific reason for not extending.
In the "worst case", Microsoft will create a new version of a data entity. When Microsoft decides to do this, there might be a data model change as base for this. In that case, you will have to review your duplicated entity as well. So, I do agree with Nikolaos to extend the existing entity.
A use case for creating a new entity would be in case the standard entity is not performing well enough and you want to create a new one with less tables and fields to get a higher throughput.
Many thanks Nikolaos. The step I missed was not referencing the models the tables that made up the data entity were in, in my model. I only referenced the model the actual data entity was in. So if the data entity was in the "Application Suite" model, I had referenced that, but not the [Calendar] model which was where one of the tables was in.
I extended the data entity in the end, but had to manually update the staging table (add the fields). I saw an option to "Regenerate" or "Update" the staging table, would one of these done it for me?
I don't think that regenerate or update staging table works with extensions. But I'm not 100% sure, you can easily try.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,004
André Arnaud de Cal... 865 Super User 2025 Season 2
Sohaib Cheema 582 User Group Leader