I am making a form where I want to have Serial number as my column.Is there any way to generate serial no automatically.Please reply asap.

Hi Mnra,

write the below code in the form dsatasource initvalue method.

public void initValue()


tablename table;

select maxof(LineNum) from table; //LineNum field in tablename table.

tablename.LineNum = table.LineNum+1;




Thanx for the reply,I tried this but this is not giving the desired result.can u suggest me something else.

When should the serial no be generated automatically(i.e. event)?If you want to do the same at the time of record creation then you may use the existing number sequence functionality.

Let me know in case of any queries.

where can I find number sequence functionality? i want to have S no when ever I new record

You can find it on sales order or purchase order for SalesId,PurchId respectively.


You have to generate Number sequence for it.



Kuppusamy S

Use Number sequence.