You would place it on your action page. If you don't actually
need to reference the case number on the action page after you add
it to your database, you can actually place that logic right in
your SQL statement:
INSERT INTO #request.app.DB2DB#.anc_case
(case_number
,bank_name
,city
,state
,district
,comment
,completed
,sr_withhold)
VALUES
('#DateFormat(now(),"yyyymmdd")##TimeFormat(now(),"HHmm")#',
'#form.bank_name#',
'#form.city#',
'#form.state#',
'#form.district#',
'#form.comment#',
'#form.completed#',
'#form.sr_withhold#')
Keep in mind, the code provided creates a 12 digit number -
make sure this length works with your database scheme. Also, keep
in mind that this is not really a good way to generate a unique
number - 2 people could submit the same form during the same minute
and you would get the same case number. Probably not good for what
you want.
Do your case numbers have to be unique? If so, what are the
restrictions? digits only? Length Restrictions?