답변 3개
Hi Abhishek,Try the following code it may helpful for you:Trigger RSMnumberUpdate on OpportunitySplit (before insert,before update){ if(Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)){ List<ID> SplitownerID = new List<ID> (); List<ID> OppAccountRegionID = new List<ID> (); For(OpportunitySplit Opsp : Trigger.new){ SplitownerID.add(Opsp.Splitowner); OppAccountRegionID.add(Opsp.AccountRegionID); } List<ID> AllUserRegionsID=new List<ID>(); AllUserRegionsID = [SELECT id FROM UserRegion__c WHERE RSM__c IN : SplitownerID AND Parent_Region__c IN : OppAccountRegionID];}} I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.Thanks,Ajay Dubedi