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
Rafael Motta 9Rafael Motta 9 

how can I fill picklist whit information of another object?

hi all. 
I need to do a select 28 records fields(picklist) from the custom object "caseCustom__c" and insert those records in GC_R_Filtro_Text__c field from case object.

I can do the select of case object, but I can´t insert in it  picklist records from Casecustom__c

 could you help me ?

this  is  my script :


trigger caseCustomAfterInsert on CaseCustom__c (after Insert) {
   
   List<case> listcases = new List<case>();
   map<id, CaseCustom__c > mapcasecustom = new map<id, CaseCustom__c>();
   
   for(CaseCustom__c cc:trigger.new){
       mapcasecustom.put(cc.textCaseId__c,cc);
   }
   
   if(mapcasecustom != null && mapcasecustom.size() > 0){
       for(case cs :[select id, survey_status__c,GC_R_Filtro_Text__c from case where id in :mapcasecustom.keyset()])
       
       {
         cs.GC_R_Filtro_Text__c = String.valueof(mapcasecustom.get(cs.id).CCAnswerFiltro1__c) != null?                  String.valueof(mapcasecustom.get(cs.id).CCAnswerFiltro1__c):'';
cs.GC_R_Filtro_Text__c = String.valueof(mapcasecustom.get(cs.id).CCAnswerFiltro2__c) != null?                  String.valueof(mapcasecustom.get(cs.id).CCAnswerFiltro2__c):'';
cs.GC_R_Filtro_Text__c = String.valueof(mapcasecustom.get(cs.id).CCAnswerFiltro3__c) != null?                  String.valueof(mapcasecustom.get(cs.id).CCAnswerFiltro3__c):'';
          cs.survey_status__c = 'Aplicado';
          listcases.add(cs);
       }
    }
   system.debug('---'+listcases);
   if(listcases != null && listcases.size() > 0)
      update listcases;
}
ZhixunZhixun
Check if GC_R_Filtro_Text__c is configured as strictly enforce picklist values.