Expand my Community achievements bar.

SOLVED

Is ok to have 2 primary keys for Recipients?

Avatar

Level 6

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? 

god_prophet_1-1734545456798.png

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

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

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 6

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.

View solution in original post

2 Replies

Avatar

Community Advisor

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
     Find me on LinkedIn

Avatar

Correct answer by
Level 6

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.