Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If(invcIds.size()>0){
- List<AggregateResult> ar = [Select invoiceit_s__Invoice__c invId, MAX(invoiceit_s__Payment_Date__c) pymntdt From invoiceit_s__Payment_Plan_Installment__c Where invoiceit_s__Invoice__c IN:invcIds Group By invoiceit_s__Invoice__c ];
- for (AggregateResult a : ar){
- invcIddate.put((Id)a.get('invId'),(Date)a.get('pymntdt'));
- }
- system.debug('invcIddate'+invcIddate);
- for(invoiceit_s__Invoice__c inv : trigger.new) {
- if(invcIddate.size()>0 && invcIddate.containskey(inv.id)){
- inv.Final_Payment_Date__c = invcIddate.get(inv.id);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement