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

Duplicate records must be removed the file prior to import

(1) ShareShare
ReportReport
Posted on by 1,552
Hi,

I made an entity with natural key line num -- this field gets autocreated in the insert method.

I made access modifier for the linenum in the entity as private

when i want to import, i don't want to fill the linum -- it should be filled with the insert method
when i export i don't want to see linenum as well


i tried to import where the table is empty but got this error
The keys of the record are DEFINITIONGROUP, EXECUTIONID, LINENUM, PARTITION. Duplicate records must be removed the file prior to import
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,983 Super User 2025 Season 2 on at
    Duplicate records must be removed the file prior to import
    Hi Junior AX,
     
    As the entity needs unique records, you can write logic in the data entity to fill the linenum field with a sequence for the staging table. Then it would meet the requirement for the entity key. 
    What exactly is this table about? 
  • junior AX Profile Picture
    1,552 on at
    Duplicate records must be removed the file prior to import
    Hi Andre,
     
    The table is like a middle stage where we insert records to it before inserting to the actual tables.
    It has fields that are related to another table.. it also has status field(new, inProcess, error)
    There is nothing unique. So i added the lineNum as a natural key for the entity.
     
    I already added a logic to fill lineNum in the insert method of the table...is it not enough? Do i need to add the same logic of filling lineNum in postload method for example?
  • André Arnaud de Calavon Profile Picture
    299,983 Super User 2025 Season 2 on at
    Duplicate records must be removed the file prior to import
    Hi Junior AX,
     
    The error comes from the staging validation as the entity key should be unique in the source file. You can indeed try to fill the staging table using the postLoad() method. When possible, you can also add the line numbers in your source file.

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... 684 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 588

#3
Martin Dráb Profile Picture

Martin Dráb 542 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans