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 

Multiple lines insert into a text field

I want to maintain history tracking of a field on task .

When ever the field is edited or updated i want to add Date - Name - Comments on the newly created field .

 

Example :

 

Existing field   - Test -  Tesitng  -  17/12

New Field - Testing -  17/12 - Raj

 

Existing field   - Test -  Tesitng in Progress  -  18/12

 

New Field - Testing -  17/12 - Raj

 

                      Tesitng in Progress  -  18/12  - Sam

 

Existing field   - Test -  Tesitng Completed -  19/12

New Field - Testing -  17/12 - Raj 

                       Tesitng in Progress  -  18/12  - Sam

                       Testing -  Tesitng Completed -  19/12 - Raj

 

asish1989asish1989

Hi Raj

 I have a sugession .please try in my way...

  1-first fetch all the value 

   2- add them into a List<String>

   3-In a loop insert all the value 

  Here is some code you can refer...

Public Account account{get;set;}
List<String>finalString = new List<String>();
account = [SELECT id, Name,TestMultiSelect__c, NewTextArea__c FROM Account WHERE id =:'0019000000DSmY6'];
System.debug('###############FINALSTRING############'+finalString) ; 
       for(integer i =0; i<finalString.Size(); i++){
           if(account.NewTextArea__c ==null){
               account.NewTextArea__c = finalString[i]+'\n';
            }
            else {   
            account.NewTextArea__c += finalString[i]+'\n';
            }
        } 
       
       System.debug('###############NewTextArea__c############'+account.NewTextArea__c) ;
update account;

 For reference please go through this two link

http://boards.developerforce.com/t5/Visualforce-Development/Display-multiselect-picklist-values-in-vf-without-semicolon/m-p/503471#M56016

 

Did this post answers your question if so please mark it solved so that others get benifited.

 

       Thanks