A new number cannot be assigned because x has not been saved or deleted.

I am getting this error when i am trying below steps

Create One journal under GL > General Journal . Then Go to lines - A line is already created with voucher x. Then, When i click on new I am getting this error.

A new number cannot be assigned because x has not been saved or deleted.

I seems you have an uncommitted voucher number. Have a look at \Classes\NumberSeqFormHandler (for lastNumber)
How does the first line is created?

Hi,

When I create General Journal, by default line is created in JournalVoucher form. But after opening the journal voucher form, if i click on new I am getting that error. But if i save that record and then if i click new I am not getting the error. When General Journal is created, lastnumber is empty. But After first line is created by default and if i click new, then that first line voucher numebr is displayed in " lastnumber ", so its throwing error. Can you let me know any more details that i should try to get rid of this error. Thanks

Now i can see what you are saying. What you have explained is the standard behavior.
If you open the journal lines form, it will create a new record and that will not be saved, unit you enter some data or manually save it and you cannot create another record without saving/deleting the existing line.