You can handle this through some custom error message in trigger in case the user editing is the owner, then you can convert the leads otherwise it restrict your operation.
trigger trigMapFieldsdata on Lead (before update)
{
for(Lead lead:System.Trigger.new)
{
if (lead.IsConverted){// Your business logic here..
Hence you can put a trigger on the creation of these objects which will raise a if the user converting is not the owner.
Alternatively you can have a custom button of your own on which you can fire validation using javascript API to check if the user converting is the owner if yes redirect user to the following url:-
You can handle this through some custom error message in trigger in case the user editing is the owner, then you can convert the leads otherwise it restrict your operation.
trigger trigMapFieldsdata on Lead (before update)
{
for(Lead lead:System.Trigger.new)
{
if (lead.IsConverted){// Your business logic here..
You can handle this through some custom error message in trigger in case the user editing is the owner, then you can convert the leads otherwise it restrict your operation.
trigger trigMapFieldsdata on Lead (before update)
{
for(Lead lead:System.Trigger.new)
{
if (lead.IsConverted){// Your business logic here..
}
}
All Answers
Hi Abante,
Conversion of a lead leads to creation of :-
Hence you can put a trigger on the creation of these objects which will raise a if the user converting is not the owner.
Alternatively you can have a custom button of your own on which you can fire validation using javascript API to check if the user converting is the owner if yes redirect user to the following url:-
"https://ap1.salesforce.com/lead/leadconvert.jsp?retURL=%2F"+ LeadId + "&id=" +LeadId
else you can alert the user with appropriate message.
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Thanks a lot Ispita,
Just one more thing, Do you have the code of the trigger you mention?
Thanks again!!
You can handle this through some custom error message in trigger in case the user editing is the owner, then you can convert the leads otherwise it restrict your operation.
trigger trigMapFieldsdata on Lead (before update)
{
for(Lead lead:System.Trigger.new)
{
if (lead.IsConverted){// Your business logic here..
}
}
Thank you Ispita, It worked perfectly:
trigger leadPreventer on Lead (before insert, before update)
{
if(trigger.isUpdate)
{
for(Lead lead:System.Trigger.new)
{
if (lead.IsConverted && UserInfo.getUserId()!=lead.OwnerId)
{
lead.addError(' It's not possible');
}
}
}
}
You are most welcome.