Wednesday, September 19, 2012

How to generate Sequence Number using Groovy expression



Usecase : Generate a sequence number at entity level using Groovy expression
Solution : Goto Entity -> Select the attribute with 'Number' as data type -> Default Values -> Choose expression -> Paste below groovy expression ( Modify with your sequence name)

       

            (new oracle.jbo.server.SequenceImpl("XXATDTPR_AA_DET_S", adf.object.getDBTransaction())).getSequenceNumber()
       
 
(new oracle.jbo.server.SequenceImpl("EMPLOYEES_SEQ",adf.object.getDBTransaction())).getSequenceNumber()

No comments:

Post a Comment