Salesforce trigger for Convert Lead Owner Queue to Logged in User
trigger leadConvertToLoggedInUser on Lead (before update) {
User u = [select Id, Name from User where Id =: UserInfo.getUserId()];
for(Lead Ld : Trigger.New){
String leadOwner = Ld.OwnerId;
if(leadOwner.startsWith('00G')){
Ld.OwnerId = u.Id;
}
}
}
No comments:
Post a Comment