+ Start a Discussion
KyoKyo 

Subject UnRequired Field in Standard Field

I can not save because the Field Subject in Interaction Log is  Required. I want to have some unRequiredit.

 

 

trigger PopSubject on Task (before insert) {
   
    //Set of SaleOrder Ids
    Set<Id> CaseID = new Set<Id>();
            
    for (Task Ta : trigger.new) {
        CaseID.add(Ta.WhatID); //A set of SaleOder 
    }        
     Map<Id, Case> pSale = new Map<Id, Case>([SELECT a.id, a.subject FROM Case a WHERE a.id IN :CaseID ]);
                                                         
    for(Task fcon : Trigger.New){
        fcon.subject  = pSale.get(fcon.WhatID).subject;
    }
    

}

 Thank you so much.

 

 

bob_buzzardbob_buzzard

If a standard field is required, you have to provide it - there's no way around it that I'm aware of.