Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I was importing data from Salesforce today, when my BULK INSERT failed with too-long data: longer than the field length as reported from Salesforce itself. I discovered that this field, which Salesforce describes as a TEXT(40), has values up to 255 characters long. I can only guess that the field had a 255-character limit in the past, was changed to TEXT(40), and Salesforce has not yet applied the new limit.

When are field lengths enforced? Only when new data is inserted or modified? Are they enforced at any other point, such as a weekly schedule?

Second, is there any way to know the actual field length limit? As a database guy, not being able to rely on the metadata I've been given makes me cringe. As just one random example, if we were to restore this table from the backup I assume that the long values would bomb, or possibly be truncated.

I'm using the SOAP API.

1 Answer

0 votes
by (32.1k points)

Field lengths are supported on create/update. If you later decrease the length, existing records are not truncated. I think that this is because salesforce is storing these as 255's regardless.

Practically speaking, the "original" field limit for any text field in salesforce must be considered as 255. This is because it is probable that at some point in the past, records are embedded when the limit is as high as 255.

And yes, you can dump that table and re-insert it. You can easily reject records because of values which exceed the field size and presently defined.

To learn in-depth about Workflow in Salesforce, sign up for an industry based Salesforce Admin certification.

Browse Categories

...