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
Amruta ChaudharyAmruta Chaudhary 

how to add new text in text field which depand on picklist field ?

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Amruta,

Can you please ellobrate your question so community can help you  on the requirement.

Thanks,
CharuDuttCharuDutt
Hii Amruta
Try Below Code
Trigger TestTrigger on Opportunity(Before Insert,Before Update){
if(Trigger.IsBefore){
 if(Trigger.IsInsert){
   For(opportunity opp : trigger.new){
     if(opp.StageName == 'Closed Won'){
       opp.TextField__C = 'Closed Won';
     }else if(opp.StageName == 'Closed Lost'){
       opp.TextField__C = 'Closed Lost';
      }
    }
   }
    if(Trigger.IsUpdate){}}
      For(opportunity opp : trigger.new){
         if(opp.StageName == 'Closed Won' && opp.StageName != Trigger.OldMap.get(Opp.id).StageName){
             opp.TextField__C = 'Closed Won';
         }else if(opp.StageName == 'Closed Lost' && opp.StageName != Trigger.OldMap.get(Opp.id).StageName){
              opp.TextField__C = 'Closed Lost';
         }
      }
}
Please Mark It As Best Answer If It Helps
Thank You!