[SalesForce] Handling Community Nickname field for Customer Portal registration

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.

  1. Is there a way to make the community nickname field not required and/or not required to be unique for customer portal users?

  2. 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:

  1. 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.

  2. 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.

Thanks!

Best Answer

What other information are your users entering?

Could you do combinations? FirstNameLastName_Zipcode or something like that?

Or include the email domain?

Related Topic