Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id : S2es4FONKnRU3tIlbrKFqP
Finance | Project Operations, Human Resources, ...
Unanswered

Duplicate records must be removed the file prior to import

Like (1) ShareShare
ReportReport
Posted on 13 Jul 2023 16:37:51 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
    292,865 Super User 2025 Season 1 on 16 Jul 2023 at 21:26:06
    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
    1,550 on 14 Jul 2023 at 07:24:25
    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
    292,865 Super User 2025 Season 1 on 13 Jul 2023 at 22:04:53
    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans
Loading complete