web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

ErrorTablePrimaryKeyNotMandatory: The primary key must be mandatory in staging table

(0) ShareShare
ReportReport
Posted on by 1,552
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?
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,601 Most Valuable Professional on at
    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.
  • junior AX Profile Picture
    1,552 on at
    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

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. André Arnaud de Cal... 650 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Abhilash Warrier 287 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Martin Dráb 225 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans