Skip to main content
Answer

Error on custom DAC regarding multiple keys on table

  • November 24, 2025
  • 3 replies
  • 36 views

Joe Schmucker
Captain II
Forum|alt.badge.img+3

I inherited a project.  When I moved the code from the Project Editor to my VS extension, I have an error regarding multiple keys.

This was apparently not a problem when the code was left in the project editor, but it is a problem in my VS extension library.  Here is a snip so you can see the squiggles:

 

I don’t know if removing the IsKey from either field will cause a problem.  Would it be safe to suppress the error with a comment?

 

 

 

Best answer by aleksandrsechin

Hi, ​@Joe Schmucker 
I don’t think it’s a good practice to keep a second IsKey when you already have IsKey together with the PXDBIdentity attribute. I would recommend the following: if you really need to keep the SlotID field, keep the IsKey on this field and remove it from SiteID.

3 replies

Forum|alt.badge.img+3
  • Jr Varsity I
  • Answer
  • November 24, 2025

Hi, ​@Joe Schmucker 
I don’t think it’s a good practice to keep a second IsKey when you already have IsKey together with the PXDBIdentity attribute. I would recommend the following: if you really need to keep the SlotID field, keep the IsKey on this field and remove it from SiteID.


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • November 24, 2025

Hi ​@aleksandrsechin   I’ll do that and see what happens.  Thanks for the help.


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • November 24, 2025

@Joe Schmucker this is one of the Acuminator checks. As Acuminator is not integrated in the code editor, the error was not there before you opened it as a project in VS.

 

The general best practice is that you either have the identity field as a single key field, or a combination of any other fields as a key. But you should not do both since it leads to some nasty side effects.