function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BlobBlob 

What is the maximum length of a UserRole Name when using Partner portal?

We are having an issue with a client setup with the partner portal where the API is returning a field value longer than what the describe of the object is saying is the maximum length.

This is happening when an account is converted to a partner account there are three roles created.
The role names are created by taking the account name and appending three strings:
Partner User
Partner Executive
Partner Manager

An account name can be 255 characters, and a role name can be 40 characters when entered via the UI.
The describe of UserRole returns that the field "Name" can be 40 characters (120 bytes)

During testing when entering an Account Name with the maximum amount of characters (255) the role names for the 3 roles created ended up truncating the account name and adding the three strings afterwards. The result was, for the longest role name, the first 62 characters of the account name and then adding the 18 characters of " Partner Executive", to make it a total of 80 characters. This is more than the API is saying that the maximum field length should be.

How long can the UserRole Name returned by the API really be?

- Peter
BlobBlob
Is there some more information that is needed for this question?
EdHEdH
Seems odd that the describe is saying 40 characters, but then it is returning a string that is 80 characters.

I can see this using sforce explorer.

Two questions:
1) What is the max length of the UserRole Name field?
2) Why is the describe saying 40, but I get more then 40 character back.

Thanks
Ron HessRon Hess
This does sound like a bug, please contact salesforce support or file the bug directly.
thanks