Is ok to have 2 primary keys for Recipients? | Community
Skip to main content
Level 6
December 18, 2024
Solved

Is ok to have 2 primary keys for Recipients?

  • December 18, 2024
  • 1 reply
  • 651 views

I'm adding some fields to the abc:recipients (recipient's extension) schema. 

It currently has 01 PK in the base recipient schema. I need to add an attribute from the extension also as PK.  So both are not a combined PK, rather individual PKs.

Is this ok? 



This is how I have set the codinterno field as PK:

<key internal="true" name="codinterno_pk">
<keyfield xpath="@codinterno"/>
</key>

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by god_prophet

My main goal was to have "codinterno" as a unique field.


@parthasarathy  suggested doing: 


<dbindex name="myIndex" unique="true">

<keyfield xpath="@myField"/>

</dbindex>

Since it was my main goal to have that as a unique field, Paratha suggestion works for my case.

Thank you both.

1 reply

Manoj_Kumar
Community Advisor
Community Advisor
December 18, 2024

Hello @god_prophet  My recommendation would be create only one primary key in Recipient schema. @id field is defined as PK by default. So  I would suggest creating "codinterno" as another attribute.

Manoj  | https://themartech.pro
god_prophetAuthorAccepted solution
Level 6
December 19, 2024

My main goal was to have "codinterno" as a unique field.


@parthasarathy  suggested doing: 


<dbindex name="myIndex" unique="true">

<keyfield xpath="@myField"/>

</dbindex>

Since it was my main goal to have that as a unique field, Paratha suggestion works for my case.

Thank you both.