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);
}
}
}
}
}
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