Salesforce Certified Application Architect

Friday 27 December 2013

How to pass Trigger.OldMap & Trigger.newMap Record Id In Apex Class with Future Method:

Note: We can pass like this...


Global Class TestClass
{

    @future
    public static void sharetoSupervisorMethod (set<Id> listPromotion_Shopids,set<Id> oldsetPromotionShop,boolean is Insert,boolean isUpdate,Map<Id,Date> oldLatestSaleDate,Map<Id,Boolean> oldNoSellThru)
    {
        
        list<Promotion_Shop__c> listPromotion_Shop = [select id,shop__c,promoter__c,Latest_Sale_Date__c,No_sale_t hrough__c,Promotion_Shop__c.Shop_Supervisor__c from Promotion_Shop__c where id in:listPromotion_Shopids];

 for(Promotion_Shop__c oPromotion_Shop : listPromotion_Shop)
   {
  if(isUpdate)
            {
                if(isUpdate && !(oPromotion_Shop.Latest_Sale_Date__c != oldLatestSaleDate.get(oPromotion_Shop.Id) || oPromotion_Shop.No_sale_through__c != oldNoSellThru.get(oPromotion_Shop.Id)) && oPromotion_Shop.Promoter__c !=null && oPromotion_Shop.Shop_Supervisor__c !=null)
                {
                    sPromoterId.add(oPromotion_Shop.Promoter__c);
                }
            }

}


}
}
        

No comments:

Post a Comment

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...