Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Duplicate records must be removed the file prior to import

(1) ShareShare
ReportReport
Posted on by 1,550
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
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,160 Super User 2025 Season 1 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.
  • junior AX Profile Picture
    junior AX 1,550 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
    André Arnaud de Cal... 292,160 Super User 2025 Season 1 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? 

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans