I received an exception while trying to insert an order item. It appears to be that the description field allows only 255 characters; sometimes my descriptions goes beyond 255.
I will shorten the length of the description before inserting the entry. See the code as follows:
Order ord = new Order(.....);
String description = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, ';
if(description.length() > 255){
description = description.abbreviate(255);
}
ord.Description = description;
insert ord;
I am wondering whether there is an easier way to accomplish this by using the Salesforce built-in features. Meaning without writing code.