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

Custom data entity not calling validateWrite()

(1) ShareShare
ReportReport
Posted on by 596
Hello:
I created a custom data entity based on a custom table. In testing, I found a number of issues. First, the table has a validateWrite() which works when I create records from the custom form attached to that table, but validateWrite() is not called using a DM job using that entity. I've tried adding validateWrite() and validateField() to the entity without success. Secondly, when I use the public collection name in the url (i.e., https://.../data/[public collection name]), no records are returned. I'll add that I created the entity by duplicating and modifying an existing entity. 
I have the same question (0)
  • Layan Jwei Profile Picture
    8,060 Super User 2025 Season 2 on at
    Custom data entity not calling validateWrite()
    Hi Community member,

     
    Go to SQL server and write a query "select *from customEntity" Does it return anything? If no, then maybe there is an issue with your joins or the tables really have no data.
     
    Also make sure that the label for your new entity and it's staging table is different than the entity you copied it from (it needs to be unique) same thing goes for the public collection name and public entity name.

    After you fix those, put a break point on the insert method and valdiate write method in the table and see if it gets called when you import via DMF.
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • André Arnaud de Calavon Profile Picture
    300,088 Super User 2025 Season 2 on at
    Custom data entity not calling validateWrite()
    Hi,
     
    Can you tell what validation logic you have and what X++ coding was used at what place in the entity? 
     
    Related to the duplication of the data entity, did you change the public collection name and public entity names to have unique names across all the entities? Did you synchronize the database before retrieving the records from the entity? 

    What changes did you apply after duplicating the entity?
  • Mohamed Amine Mahmoudi Profile Picture
    26,362 Super User 2025 Season 2 on at
    Custom data entity not calling validateWrite()
    Hi,
     
    You must launch build with synchro and then refresh entity list through the DM parameters.
    Best regards,
    Mohamed Amine MAHMOUDI
  • Layan Jwei Profile Picture
    8,060 Super User 2025 Season 2 on at
    Custom data entity not calling validateWrite()
    Hi Community member,
     
    If u import using the original entity, does the validateWrite of the table gets called when you import?
     
    Regarding records not being returned, if you want to return records from a legal entity that is not equal to the user default legal entity, then you need to use cross-company=true 
     
    http://[baseURI\]/data/FleetCustomers?$filter=dataAreaId eq 'usrt'&cross-company=true

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     
  • Layan Jwei Profile Picture
    8,060 Super User 2025 Season 2 on at
    Custom data entity not calling validateWrite()
    Yes it could be that sth went wrong while copying it because validate write should be called. Update us please with your findings.
     
    And did calling the url work now after adding cross-company?
     
    When your issue is fixed, then please don't forget to verify the answers that helped.
  • André Arnaud de Calavon Profile Picture
    300,088 Super User 2025 Season 2 on at
    Custom data entity not calling validateWrite()
    Hi,

    You mentioned you duplicated the entity from another one. Have you also tried creating a new data entity using the wizard in Visual Studio?

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 580 Most Valuable Professional

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 554

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans