• P.J Maman
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
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?
Hello.  A custom object was created called project and it only has on field (lookup) in common with the Opportunity object making it difficult to report on.  What will be the best way to relate these objects?
Thanks.
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?