anujahthakur
13th December 2014, 06:26
what is the code for auto generating any sequence after click on new button...for e.g..1,2,3

vinay sharma
13th December 2014, 08:19
Hi,

You may try this:

field.fieldname:
before.field:


fieldname = actual.occ * 10

Regards,
Vinay Sharma

anujahthakur
13th December 2014, 08:46
I wrote d code...but its just giving value 10 on d field..its nt incrementing

field.kpanu513.item:
before.field:
kpanu513.item = str$(actual.occ * 10)

soumya093
13th December 2014, 08:59
field.kpanu513.item:
after.field:
if update.status = add.set then
domain tcpono c
select max(kpanu513.item):C
from kpanu513
where your condition
selectdo
kpanu513.item = c + 1
display("kpanu513.item")
selectempty
kpanu513.item = 1
endselect

sachinbaan
13th December 2014, 10:44
Hi,

Better to write in

"before.new.object:"

anujahthakur
13th December 2014, 16:53
Thank u all for d reply....and...soumya... thks for the code....but wouldn't it give me an error after if....then...bcoz u have just declared variable c....

kevalghelani
15th December 2014, 05:26
Hi..
Write Your Code as:

before.new.object:

domain tcpono max.val

select max(field_name):max.val
from table_name
selectdo
field_name = max.val + 1
selectempty
field_name = 1
endselect


here field_name is your field name of numeric type that you want to increment

soumya093
15th December 2014, 08:19
No Dear it will not give any error .. but as said its better to write in before.new.object event..