2

The length of UserName field in the standard User object is 80 characters (ie. Text(80)).

Recently in my production org, a User record was created with a Username more than 80 characters. Due to this issue, one of the batch jobs in ETL broke.

Has anybody faced this issue? As per our functionality, User record gets created via Apex code. There is no special character present.

I am trying to investigate how Salesforce allowed an 81 character Username.

Can anyone assist me on this issue?

  • Can you share the problem UserName with us? Is it possible that a character encoding issue expanded the length out? E.g. Salesforce sees it as 80 characters in one encoding, but the external tool sees it as 81 characters in a different encoding. – Daniel Ballinger Apr 26 '16 at 0:25
  • @DanielBallinger, we have Apex webservice that creates user record in Salesforce, so it gets triggered by internal. – sivarajan Dhandapani Apr 26 '16 at 20:10
  • OK, can you please share the problem UserName and the Apex webservice code that creates the User record? You should be able to edit this into you question. – Daniel Ballinger Apr 26 '16 at 21:05
2

This is not true:

Name Combined first name, middle name (beta), last name, and suffix (beta) of user, as displayed on the user detail page.

First Name First name of user, as displayed on the user edit page. Up to 40 characters are allowed in this field.

Middle Name Middle name of the user, as displayed on the user edit page. Up to 40 characters are allowed for this field.

Last Name Last name of user, as displayed on the user edit page. Up to 80 characters are allowed in this field.

Suffix Name suffix of the user, as displayed on the user edit page. Up to 40 characters are allowed for this field.

So potential max length for the User Name could be 200 (40+40+80+40) characters (with Enabled Name Suffixes for Person Names) or 120 with the standard First + Last Name combination. 80 characters is a hard limit for the Name field on Custom Object

  • The field is Username, not User Name. – Adrian Larson Apr 25 '16 at 22:03
  • @AdrianLarson, my fault. – o-lexi Apr 25 '16 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.