We have a customized Force.com Site + Customer Portal for the authenticated portion of the Force.com Site. We have self registration enabled. Currently the nickname and alias fields are required on the User. They really don't make any sense for our application and, I'd imagine, not for everyone else's applications, since community nickname and alias aren't industry standard fields required on any other website I've registered for.
Since the alias is not required to be unique, I can simply hack off the first 8 characters or less of the last name and use that which enables me to be able to not present the user with an unnecessary alias field.
However, the community nickname is required to be unique, so it is a bit more tricky. Right now, I just let the user enter something for it, but it doesn't really make any sense, so I'd like to remove it.
Is there a way to make the community nickname field not required and/or not required to be unique for customer portal users?
If not, what is a good strategy for automatically generating them without having the user ever having to know about them?
For #2, I've thought of two possible solutions:
Have a custom setting that contains a number, say nicknameCounter, and use that as the nickname, incrementing it each time that it is used. The problem that I see with this is that it would be possible for a user to get the same number as another user if they both get their numbers before they increment. I could mitigate that by say, prefixing the increment to the first 10 characters of the last name + first 10 characters of the email, etc.
I've also thought about adding an autonumber field to the User called nicknameCounter and use that to populate the nickname, but I'm not sure how that will work timing wise.
Surely, other people have this issue. I'd appreciate learning how others handle it.