Auto generation field

Hi,

I've been creating an application for onboarding clients. For this I want to create an auto generated field in CDT. whenever a new client register for onboarding and successfully submits the form, automatically the unique onboarding number have to create for every client.

Is it possible to create?

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi in order to autogenerate the value in any column (in normal use case it is the primary key of the CDT "id") use @GeneratedValue annotation in the xsd

    in the database table mark the value as autoincrement. 

    This will create a new autoincrement value each time a transaction is made.

    It should look something lie this

    <xsd:element name="appianColumnName" nillable="true" type="xsd:int">
            <xsd:annotation>
              <xsd:appinfo source="appian.jpa">@Id @GeneratedValue @Column(name="databaseColumnName", nullable=false, unique=true, columnDefinition="INT")</xsd:appinfo>
            </xsd:annotation>
          </xsd:element>

Reply
  • 0
    Certified Lead Developer

    Hi in order to autogenerate the value in any column (in normal use case it is the primary key of the CDT "id") use @GeneratedValue annotation in the xsd

    in the database table mark the value as autoincrement. 

    This will create a new autoincrement value each time a transaction is made.

    It should look something lie this

    <xsd:element name="appianColumnName" nillable="true" type="xsd:int">
            <xsd:annotation>
              <xsd:appinfo source="appian.jpa">@Id @GeneratedValue @Column(name="databaseColumnName", nullable=false, unique=true, columnDefinition="INT")</xsd:appinfo>
            </xsd:annotation>
          </xsd:element>

Children