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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Validate in Data Entity or Staging table?

(0) ShareShare
ReportReport
Posted on by 122

Where do you usually validate when importing data using data management and why?

I have the same question (0)
  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    validations will apply in both "Source to Staging" and "Staging to Target steps."

  • xppdev Profile Picture
    122 on at

    It means that is it okay if I only put validation method in Staging table? What if I skip the staging table?

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    Kindly Refer to this hope it will cover all what you need

    docs.microsoft.com/.../validations-defaults-unmapped-fields

  • Suggested answer
    Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    Staging tables are used just in certain cases (you can use data entities via OData, from code etc.), therefore that's not a good place for things like validations. Business logic for a data entity should be implemented inside the data entity.

  • xppdev Profile Picture
    122 on at

    Based from what I've read. Staging tables are generated to provide intermediary storage. This enables the framework to do high-volume parsing, transformation, and some validation.

    My initial thoughts on that was I should implement the validation in staging tables because they are intended to do high-volume stuff.

    Are there any performance issues if I import 10 thousand lines of an excel file using data entity validation?

    Thanks Martin!

  • Verified answer
    Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    A super-fast validation is useless if it's not called at all. And that would often be the case with your design.

    Staging tables are used just in some cases and they're populated by SSIS, which doesn't execute any X++ validations. You can execute some X++ code after importing the data, but I don't see any benefit of running validations there.

    The sole purpose of staging tables is to get data from files to F&O where you can work with the data. Business logic, including validations, is executed by data entities in the step, where data is validated and imported.

    Also, if you don't import data from files, no staging table is used any validation you put there would be bypassed.

  • xppdev Profile Picture
    122 on at

    That's really helpful. Let's say I use excel file as a source for importing data through data management. The best way to do is, write your validation code inside validateField or validateWrite in the data entity and leave the staging table methods alone.

    Based from your answers I can apply that to an example scenario wherein I have a custom table that contains old invoices and I'll implement a custom validation in Vendor Invoice Journal Line data entity where I check if the invoices already exists in the old invoices table. I'll probably put the logic in validateWrite or validateField for that data entity.

    Thanks again.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans