How to generate Automatic Primary Key in Apache Ofbiz?

698 views Asked by At

How can I generate an automatic unique sequence(for primary key) in my form ie when user fills the form, an automatic form id (which will be the primary key for that form)is generated in Apache Ofbiz?

1

There are 1 answers

0
Senthilmurugan On

Ofbiz maintains sequence of a table in Sequence_Value_Item Table. Every sequence of a table is starts with 10000. You can get the Sequence Number using Delegator.

   delegator.getNextSeqId("YourTableName");

Set this sequence with Generic Value to Create new Record.