You need to sign in to do that
Don't have an account?
masthan khan
Create A trigger with calculating lead score when a lead is inserted
Hai,
We have scenario like this when ever new lead is created lead score should be calculated and inserted in feild name Leadscore__c using before Trigger.
considering
Email -10 points,
Date of Birth- 10 points
Annual Revevenue 10points
Phone--10 Points
Contact Address - 10 Points
Company -10 points
Position__c- 10 points.
With Regards
Masthan Khan.
We have scenario like this when ever new lead is created lead score should be calculated and inserted in feild name Leadscore__c using before Trigger.
considering
Email -10 points,
Date of Birth- 10 points
Annual Revevenue 10points
Phone--10 Points
Contact Address - 10 Points
Company -10 points
Position__c- 10 points.
With Regards
Masthan Khan.
I tried with above code it is throwing following error.
Error: Compile Error: Incompatible types since an instance of Lead is never an instance of Lead at line 3 column 24.
With Regards.
Try this now
I am trying to write this code on before trigger on lead object, it is throwing following error.;
Error: Compile Error: Variable does not exist: firstname at line 4 column 6
trigger leadscore on Lead (before insert) {
integer score=0;
for(lead a:Trigger.new){
if(a.firstname !=null)
score=score+10;
}}
With Regards
Masthan Khan
I am trying to write this code on before trigger on lead object, it is throwing following error.;
Error: Compile Error: Variable does not exist: firstname at line 4 column 6
trigger leadscore on Lead (before insert) {
integer score=0;
for(lead a:Trigger.new){
if(a.firstname !=null)
score=score+10;
}}
With Regards
Masthan Khan
Please check below sample code :
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com