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

Validation in Import or export ( data entity )

(0) ShareShare
ReportReport
Posted on by 30

Hi

If I need to put any kind of Vslidation in data entity during EXPORT or IMPORT,  then let me know how will achieve this?

Please give me more shed on this 

I have the same question (0)
  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at
    RE: Validation in Import or export ( data entity )

    Hi Arpan,

    Not sure what you would want to validate while exporting records using a data entity. You can check here for the ways to validate a data entity.

  • @rp@n Profile Picture
    30 on at
    RE: Validation in Import or export ( data entity )

    Hi Gunjan,

    I am just asking in general. If required validation like suppose datatype mismatch sometime happened, so, where we need to write code for validation before Import or Export

    Please give me more shed on this 

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at
    RE: Validation in Import or export ( data entity )

    Hi Arpan,

    The data being exported is already from D365 F&O. So, you won't need any validation for data type mismatch. For the import this would be taken care of by the entity. In case of any data mismatch, you would get errors. For additional validations you can check the link I provided above.

  • @rp@n Profile Picture
    30 on at
    RE: Validation in Import or export ( data entity )

    So, you mean for importing , if datatype mismatch occur, the data entity will take care. No need to worried.

    For any other validation if required, then we need to think.

    Is it ?

  • @rp@n Profile Picture
    30 on at
    RE: Validation in Import or export ( data entity )

    I have go through the link

    I saw the best place to write validation is Table 》Validate field or Validate write

    Is it correct?

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at
    RE: Validation in Import or export ( data entity )

    Table > ValidateField or ValidateWrite will be called wherever the table is used. If you need validations in all the places the table is used like forms, you should put the code in the table methods.

    If the validation is specific to the data entity, you should use the data entity validation methods.

  • @rp@n Profile Picture
    30 on at
    RE: Validation in Import or export ( data entity )

    Here  data entity means table right?

    Why two kind of validation?

    Table level or Data entity level.

    Here only I  have conditions

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at
    RE: Validation in Import or export ( data entity )

    You can consider SalesTable and SalesOrderHeaderV2Entity as an example.

    SalesTable has the method validateWrite. Whenever any data is written into SalesTable, it will validate using this method. For an example, if the SalesId field is not filled in, this method will throw an error.

    pastedimage1605378603126v1.png

    This validation will work whether the record is being created from sales order form or using X++.

    In the data entity, there is a validateWrite method as well. This method has a validation which says that this entity does not support updates to retail orders. This validation is specific to the entity only, which is why it is being done in this method.

    pastedimage1605379457841v2.png

    For more info on how these methods work, you can check the link in the first reply.

  • @rp@n Profile Picture
    30 on at
    RE: Validation in Import or export ( data entity )

    Yes, both Validate write method is checked whether Sales I'd is filled or not?

    Only the difference is both are called from different area...

    One from Table and another from Data entity, both having each validate write method. 

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at
    RE: Validation in Import or export ( data entity )

    Please check the screenshots.

    The table validateWrite method checks for SalesId. The data entity validateWrite checks if the sales order being updated is a retail order. In case it is, update using the entity is not supported. But a retail sales order can be updated at the table level.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,029

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 582 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans