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

Announcements

No record found.

News and Announcements icon
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 628
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. 
  • Layan Jwei Profile Picture
    8,301 Super User 2026 Season 2 on at
    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
    307,224 Super User 2026 Season 2 on at
    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,826 Super User 2026 Season 1 on at
    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,301 Super User 2026 Season 2 on at
    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,301 Super User 2026 Season 2 on at
    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
    307,224 Super User 2026 Season 2 on at
    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?
  • Layan Jwei Profile Picture
    8,301 Super User 2026 Season 2 on at
    Hi Community member,

    I'm glad your issue is fixed. Please don't forget to verify the answers that helped.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 475 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 399 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 374

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans