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
RajevlsRajevls 

Copy one Text field into another text field on task

I want to copy a text field data to another text field . Both the fields are on the same object Task.

 

Sridhar BonagiriSridhar Bonagiri

Hi,

 

Let me know when you want to do it this copying activity.

 

Regards,

Sridhar Bonagiri

RajevlsRajevls

There are two fields :

1. Task Comments

2. Comments

 

When ever a new value is entered in Task Comments , i want to store that in Commnets .

Task Comments may have new value but Comments will track all the historic data of Task Comments.

Sridhar BonagiriSridhar Bonagiri

 

Hi,

 

You mean to say that 'Comments' field should contain all the old values of 'Task Comments'. Am I correct?

 

Regards,

Sridhar Bonagiri

RajevlsRajevls

Yes.. 

 

Comments should track all the text entered in Task Comments

Sridhar BonagiriSridhar Bonagiri

Hi,

 

Will you display this 'Comments' field on VF Page.

 

This is can be achieved in two ways. 1. By writing a trigger, 2. Add some javascript code in VF page.

 

Regards,

Sridhar Bonagiri

RajevlsRajevls

This requirement is to copy the value and to display it on the same record (page) . No need of any Visualforce page.

 

I need help on the trigger 

 

 

TrinayTrinay

Hi Raj,

 

try the following code,

 

for(Candidate__c irow:Trigger.new)
{
   if(System.Trigger.oldMap.get(irow.Id).Tcomment__c != irow.Tcomment__c )
   {
          // you can copy the value into another field here
   }
}