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
kurtz_wolfgang_prekurtz_wolfgang_pre 

System.DmlException: Insert failed string_too_long

Hello All,

 

  I would appreciate if anybody could provide some insight into this error:

 

The weird part of the below exception is: the field is 255 characters long and the string is not even 50 characters.

 I am at my wit's end regarding this problem. Any information would be very helpful.

 

Thanks & Regards,

K.

 

length of ReferenceNumber: 255

 

System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Reference Number: data value too large: this is 50 characters long string. (max length=25): [Reference_Number__c]
Best Answer chosen by Admin (Salesforce Developers) 
kurtz_wolfgang_prekurtz_wolfgang_pre
Thanks Souvik. Seems there was another object that's related to this object and a user had updated that field on that object while we were testing it. But still, thanks for taking the time to respond.

Regards,
K.

All Answers

souvik9086souvik9086

Reference_Number__c

This field length is 25 asgiven in the error(max length=25).

Try by Increasing the length.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

kurtz_wolfgang_prekurtz_wolfgang_pre
Thanks Souvik. Seems there was another object that's related to this object and a user had updated that field on that object while we were testing it. But still, thanks for taking the time to respond.

Regards,
K.
This was selected as the best answer