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
Zane Prater 15Zane Prater 15 

How to update a specific line in a long text field?

I have a trigger that is checking if a long text field value contains a substring variable.  I am trying to update only that line but it's appending my update at the end of the last line.
 
Best Answer chosen by Zane Prater 15
Zane Prater 15Zane Prater 15
Thank you Danish, I was able to solve using the replace (target, replacement) method after creating a map.

All Answers

Danish HodaDanish Hoda
Hi Zane,
You can do it if you have data in a map format, where you can use remove() and put() methods, else you would not be able to update a substring from the field.
Zane Prater 15Zane Prater 15
Thank you Danish, I was able to solve using the replace (target, replacement) method after creating a map.
This was selected as the best answer