what will happen if dont define autopk=true on main element of data schema in ACC | Community
Skip to main content
Level 4
January 30, 2024
Solved

what will happen if dont define autopk=true on main element of data schema in ACC

  • January 30, 2024
  • 1 reply
  • 469 views

 

@ParthaSarathy

@ParthaSarathy 

@ParthaS 

@AkshayAnand 

@Craig_Thonis 

@Manoj_Kumar_ 

@Amine_Abedour 

@Marcel_Szimonisz

@DavidKangni 

@Amit_Kumar 

@ShashankNigam02

@Ganesh5067

@Jonathon_wodnicki

1.what will happen if dont define autopk=true on main element of data schema in ACC

 

2.what will happen if i define autopk=true on main element of data schema in ACC

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 ParthaSarathy

@dishasharma , Primary key is mandatory in a schema. If you don't have any dedicated attribute for primary key, then you can define autopk="true" which will create an attribute @id with datatype as long and whenever a new data get inserted into this schema, @id will keeps on incrementing.

If you have a dedicated primary key in your schema, then you don't have to add autopk="true", instead you can create primary key using your attribute with below syntax

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

 

1 reply

ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
January 30, 2024

@dishasharma , Primary key is mandatory in a schema. If you don't have any dedicated attribute for primary key, then you can define autopk="true" which will create an attribute @id with datatype as long and whenever a new data get inserted into this schema, @id will keeps on incrementing.

If you have a dedicated primary key in your schema, then you don't have to add autopk="true", instead you can create primary key using your attribute with below syntax

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

 

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups