You need to sign in to do that
Don't have an account?
KR_Force
Entity 'Owner' not accessible in version 30.0 at line 1 column 24
I tried in all API versions getting same error. any suggestion will be greathelfull
public without sharing class LeadXXXXXOwner {
public static List<Lead> leadXXXXXOwnerUpdate(List<Lead> nLst, Map<ID,Lead>oldMap){
List<Lead>updLst= new List<Lead>();
for( Lead l : nLst){
Lead oldLead = oldMap.get(l.Id);
if(Owner.profile.name.contains('XXXXX')|| Owner.name.contains('XXXXX')||Owner.profile.name.contains('XXXXX')|| Owner.name.contains('XXXXX')){
l.Previous_Lead_Owner__c='XXXXXOwner::'+ Owner.Name;
}
}
return updLst;
}
}
public without sharing class LeadXXXXXOwner {
public static List<Lead> leadXXXXXOwnerUpdate(List<Lead> nLst, Map<ID,Lead>oldMap){
List<Lead>updLst= new List<Lead>();
for( Lead l : nLst){
Lead oldLead = oldMap.get(l.Id);
if(Owner.profile.name.contains('XXXXX')|| Owner.name.contains('XXXXX')||Owner.profile.name.contains('XXXXX')|| Owner.name.contains('XXXXX')){
l.Previous_Lead_Owner__c='XXXXXOwner::'+ Owner.Name;
}
}
return updLst;
}
}
All Answers
What exactly you want to happen and what are the conditions?
Regards.
But what are the conditions? If a user updates a Lead you want to check if the user name or profile contains 'Marketing' and if true, you want to update lead's owner to the user that has updated it?