+ Start a Discussion
Joseph FerraroJoseph Ferraro 

Portal usernames unique across orgs?

Is it possible for a portal user to have the same username in two separate orgs.  For example, Company A has a portal and Mike Smith chose msmith@gmail.com as the username.  Company B also has a portal and Mike Smith needs to be a portal user in Company B as well and wants to choose msmith@gmail.com as the username.  Is this possible?  The reason I ask is that we're getting the following error message in one of our customer's portals, even though we have check the user table before registration to catch the error if the user tries to use a username that already exists in the user table.


There was an error in registering a user in site <PORTAL_NAME_HERE>. The error message is: Duplicate Username.<br>Another user has already selected this username.<br>Please select another.


No it is not possible to have same user name in two different Orgs.You can have same Email ID in both the orgs but Username should be unique.

Shashikant SharmaShashikant Sharma

No it is not possible to have any two user name similar all over salesforce. Even internal user and portal user can not have similar user name. 


What we do we use a

do while loop and add a math.random number of 3 digit to user name like if user name matches then again we do it with some other 3 digit number we try this for 10 times then only we show that message.


user name test@test.com will like test123@test.com.




Hi Joe,


From Spring 13' release - it is possible to save a portal user with an existing username on a separate org.

The same does not hold for a non-portal user.


Hope this helps.



Yael - where did you get that info (about the portal username not needing to be unique in spring 13)?  I haven't been able to find it, or confirm it with SF support.


Hi Johann,


I'm with Salesforce backline developer support team.




Claudio CastroClaudio Castro
Hi Yael,

How it is possible to add another user from another organization?
I tried but the same error appears
Error: Duplicate Username. Another user has already selected this username. Please select another.