4

What is the maximum length of the string of values that a multi-select picklist can return? If the picklist items can be up to 40 characters and users can select 100 of them, that implies that you could get 4100 character returned if the semi-colons are the only extra characters added. I'd love to find the actual documentation that provides the spec.

2

The actual byte length of the field remains at 4099 because they don't need a semicolon to delimit the last value.

Interestingly the picklist values are enumerated and those keys are used for comparisons internally. Eg Sunday;Monday;Tuesday get written away under the covers as something like 0AAK0AAL0AAM, so I wouldn't read too much into the field length ;)

3
  • 1
    Any chance you can share how you figured out that detail about how they're stored under the hood? – ca_peterson Feb 7 '14 at 22:14
  • 1
    Tried using PRIORVALUE() against a multi-select picklist field @ca_peterson – bigassforce Feb 7 '14 at 22:21
  • Lacking any official documentation, I tested this. Because the field truncates automatically, I never got an error message that I had exceeded character limits. I did get an error message if I tried to insert too many semi-colon-separated strings (System.DmlException: Update failed. First exception on row 0 with id 003i000000ZxyWxAAJ; first error: TOO_MANY_ENUM_VALUE, TestField: too many items selected: 101). I forced automatic truncation on both the item length, which trimmed my 50 character strings to 40, and on the overall length which truncated the final string to keep it at 4099. – AlwaysThinkin Feb 10 '14 at 16:00

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.