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
fiona gentryfiona gentry 

Batch Job that takes the first 255 characters from the existing long description field and populates it into the new description field

Dear Friends,
Need a help in writing Batch Job that takes the first 255 characters from the existing long description field and  populates it into the new description field

Basically a batch job to copy first 255 characters from Case_Desc and update it to Case_Desc_255__c

Your help is highly appreciated

Regards,
Fiona
Best Answer chosen by fiona gentry
David Zhu 🔥David Zhu 🔥
Would the following code work for you? (replace objectRecord by your ownd object instance)
objectRecord.Case_Desc_255__c = objectRecord.Case_Desc.substring(0,255);

All Answers

David Zhu 🔥David Zhu 🔥
Would the following code work for you? (replace objectRecord by your ownd object instance)
objectRecord.Case_Desc_255__c = objectRecord.Case_Desc.substring(0,255);
This was selected as the best answer
fiona gentryfiona gentry
Thank you david,sorry for this basic question how do i populate these aspects of batch job 
start execute and finish