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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Create Combination 2 P...
Finance forum

Create Combination 2 Primary Keys

(1) ShareShare
ReportReport
Posted on by 245

How can I create combination of 2 primary keys ? 

5287.1.png

In the case I use AllowDuplicate = No

Is there something wrong with that ? 

  • Community Member Profile Picture
    on at

    Have you set your index as unique ? Meaning having set the "Allow Duplicates" Property to "No" ?

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi Rangga Pramana,

    You can use index that has more than 2 filed as a primary key. The only issue with it  is that according to best practice Primary Key should have 1 field, so it could be used as foreign key in other tables, but it is only best practice. Ideally, you should create unique index (set AllowDuplicates = No)  that has 2 fields (or more) and set Primary Index to RecId or any other surrogate key. 

  • Suggested answer
    nmaenpaa Profile Picture
    101,172 Moderator on at

    You can have only one primary key in a table. This is set by the PrimaryIndex property of the table.

    You can however have multiple unique indexes.

  • Rangga Pramana Profile Picture
    245 on at

    Yes I did

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans