public without sharing class DeliveryTriggerHandler {
|
public static void setDeliveryReceiver(List<Delivery__c> newList, Map<Id, Delivery__c> newMap, List<Delivery__c > oldList, Map<Id, Delivery__c> oldMap)
|
{
|
|
List<String> ordidList = new List<String>();
|
Map<String,String> DeliveryToReceiver = new Map<String,String>();
|
for (Delivery__c del : newList) {
|
ordidList.add(del.SSBD_Contract__c);
|
}
|
|
List<Order> ordList = [select Id, CreatedById from Order where Id IN :ordidList];
|
for (Order ord : ordList ) {
|
DeliveryToReceiver.put(ord.Id, ord.CreatedById );
|
}
|
for (Delivery__c del : newList)
|
{
|
String s = DeliveryToReceiver.get(del.SSBD_Contract__c);
|
if (s!= del.OrderCreatedbyText__c && s!= null)
|
{
|
del.OrderCreatedbyText__c = s;}
|
}
|
}
|
}
|
|
//How annoying!s-s
|