Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

ErrorTablePrimaryKeyNotMandatory: The primary key must be mandatory in staging table

(0) ShareShare
ReportReport
Posted on by 1,550
Hi,

I created a table with an index that contains two fields (Filed1, Field2) where allow duplicate is No (Filed1 is mandatory and Field2 is not)
 
when i created the entity and staging table.. i got this BP warning on the staging table. I don't want to make Field2 as mandatory here because it's not mandatory in the standard table.

I can see that the primary index for the staging table is this index with allow duplicate no -- shall i change the primary index value on this staging table or shall i make Field2 mandatory?
  • junior AX Profile Picture
    junior AX 1,550 on at
    ErrorTablePrimaryKeyNotMandatory: The primary key must be mandatory in staging table
    Hi Martin,

    The primary index on the table itself is surrogateKey. But there is a unique index with duplicate No that contains two fields.

    The entity staging table automatically filled the primaryIndex property with allow duplicate no index.. so i think your suggestion is to leave this property as is in staging table
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,868 Most Valuable Professional on at
    ErrorTablePrimaryKeyNotMandatory: The primary key must be mandatory in staging table
    In general, primary key field should be mandatory (unless they're enums). If the table doesn't follow this rule and you don't want to (or can't) change it, then suppressing the warning sounds to me like the right approach. Changing the primary key sounds wrong and you don't want the field to be mandatory.

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,031 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,868 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans