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
P.J MamanP.J Maman 

apex trigger error on opportunity.

I stepped into an ORG which had an trigger done on Opportunity, now producing the attached error.  Here is the Trigger.
------------------------

1
2
3
4
5
6
7
8
9
trigger OpportunityUpdate on Opportunity(after insert) 
{    
      list<opportunity> lstOpp = [Select id,account.type,Client_Type__c from opportunity];
      for (opportunity o : lstOpp)
      {
        o.Client_Type__c = o.account.type;
      }
      update lstOpp;
 }------------------------------
Apex Trigger Error?
Amol waghAmol wagh
Hi, 
It looks like you have fields called Opportunity_Approved_Date__c on opportunty which is mandatory hence you are getting the error called required field missing, to resolve this please try adding values in this field.

Thanks,
Amol, www.cloudwaale.com
P.J MamanP.J Maman
Thanks for your replies.  
I did do away with the field that created the issue prior to posting this issue.  I wanted to make sure the trigger was valid.