• jayati1.392452190341368E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi,

I am including the following code to the trigger and it does not update the custom object. Please help me on this :(

if((trigger.isAfter && trigger.isInsert) || (trigger.isAfter && trigger.isUpdate))
    {
    list<Opportunity> opp = new list<Opportunity>();
    opp = [select id,Brand_Name1__c from opportunity where id  =: Trigger.new[0].OpportunityID__c];
       if(opp[0].Brand_Name1__r.Name.contains('sam') )
       {
            Trigger.New[0].Comments__c = '25';
            Trigger.New[0].Agency_Commission__c = 25;
       }
    }