0

I have a trigger code and I am trying to insert large data on Order Name. I get the below error:

Update failed. First exception on row 0 with id 8014B000000HkuPQAS; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OSM_OrderTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 8024B000000JxXQQA0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, A workflow or approval field update caused an error when saving this record. Contact your administrator to resolve it. Order Name: data value too large: Order (max length=80):

How to do I resolve this issue?

2
  • 2
    The error is right there in front of you. It says Order name is more than 80 characters
    – RedDevil
    Jun 29, 2017 at 11:55
  • Can we avoid this error by code ?how can we handle this exception Jul 17, 2017 at 10:17

1 Answer 1

1

You put split the name and then put the name in field. You can try the following piece of code in your trigger.

String str = 'kjsbjkcbjkadbscjkbjkabscbabcbsakbcjkbsabclkbaskjcbkcsvdgcjsvdcjhsdvchjsdhvchjsdvhjcsdjcbajcascascajnckjnjjkBCKJbkjckjnzkjckjdskjcbkbdskc';
str= str.substring(0,80);
System.debug(str);
campaign  camp=new campaign ();
camp.name=str;
insert camp;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .