Skip to main content
Level 6
Dec 18, 2024 6:12 PM UTC
Solved

Is ok to have 2 primary keys for Recipients?

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.
god_prophetAccepted solution
Level 6
Dec 19, 2024 7:47 PM UTC

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.

2 replies

Manoj_Kumar
Community Advisor
Community Advisor
Dec 18, 2024 11:36 PM UTC

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.

Translate
Manoj  | https://themartech.pro
god_prophetAuthorAccepted solution
Level 6
Dec 19, 2024 7:47 PM UTC

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.

Translate