I am asked to create confidential fraud complaint form which will show unique identifier number on the form.
How do I create this on page load event. This is the first time I am assigned a project like this.
The user wants person who complains should have an identity number as this will be an anonymous form.
I told them that I can show the number in Thank you page but user wants us to show number as soon as the form opens.
this is backwards. there is no point assigning an identifier before the record is saved. If I visit the comment form I don't need an identifier until I have submitted the form. there is always the possibility of canceling, in which case no ID would be issued.
once submitted assign an ID and provide this as part of the email, or a link in the email to the ticket. this is a very common and standard approach to solving this problem.
if the ID needs to be human readable or has business meaning than a number, even sequential, would be the a simple solution. I would
also recommend this value not being the PK in the database. PK with business value are never a good idea.
if the ID is just to identify the issue than a GUID is the way to go. human don't have to read it and they are 99.999999...% unique.
...back to the question at hand....
there is no reason, or need, to generate an identifier before the information is submitted. it simply does not make sense.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.