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
SATZSATZ 

How to remove the string from the rich text box?

Hi,

 

Field name called - To be scheduled. At present im using a rich text box to enter the list of class names

 

Field name called  - scheduled classes. Here im using a normal text box to enter one of the value from (To be scheduled) 

 

Both fields are in same object and,

Once i saved a record the selected value in scheduled classes will remove from the richtext box(To be scheduled)

 

Example:

 

To be scheduled contains

Value 1

value 2

value 3

 

Scheduled class contains

value 2

 

Once saved the record "value 2" should be remove from the To be scheduled field

So it looks like

 

To be scheduled contains

Value 1

Value 3

 

Thanks

Any help will be appreciated greatly

Navatar_DbSupNavatar_DbSup

Hi,


You have to write a trigger to achieve this. Try the below code as reference(This trigger is on contact object made changes accordingly):


trigger RemoveFromRichText on Contact (before insert)
{
string st=trigger.new[0].To_be_scheduled__c;
string st1=trigger.new[0].scheduled_classes__c;
string new1=st.replace(st1,'');
trigger.new[0].To_be_scheduled__c=new1;

}