• Barry allen 4
  • NEWBIE
  • -1 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I am working on a trigger and keep getting the following error but i cant seem to find the issue with the code. Any help on this would be greatly appreciated.
 
public class supportClassForRequestUpdateOpps {
     
       Map<ID, Opportunity> parentOpps = new Map<ID, Opportunity>(); 
    List<Id> listIds = new List<Id>();{

    for (Request_for_Special_Payment__c relRec: trigger.new) 
    {
    listIds.add(relRec.Opportunity_Name__c);
    }

    parentOpps = new Map<Id, Opportunity>([SELECT id, Special_Payment_Terms__c 
                                            FROM Opportunity 
                                             WHERE ID IN :listIds]);

    for (Request_for_Special_Payment__c r :Trigger.new){
    Opportunity myParentOpp = parentOpps.get(r.Opportunity);

    if(r.Special_Payment_Terms__c == '')
    {
     myParentOpp.Special_Payment_Terms__c = r.Requested_Payment_Terms__c;
    }
    
 }

  update parentOpps.values();
  }
}

 
  • January 25, 2019
  • Like
  • 0