You need to sign in to do that
Don't have an account?
siva sai 22
Variable does not exist: LastName
hi ,
while is inserting the code,i am getting error i.c "Variable does not exist: LastName" .why it is comming like this and my naming convensions is also correct.cany any one help me?
here i am aposting my code error is in line no 11 to 15(in line no 15 i am getting error like DML requires SObject or SObject list type: lead) can you resolve it ??
public class MyLe {
public string lastName{set;get;}
public string com{set;get;}
public string leadSource{set;get;}
public string phoe{set;get;}
public void create()
{
lead le =new lead();
11) le.LastName=lastName;
12) le.Company=com;
13) le.LeadSource=leadSource;
14) le.Phone=phoe;
15) insert le;
}
}
while is inserting the code,i am getting error i.c "Variable does not exist: LastName" .why it is comming like this and my naming convensions is also correct.cany any one help me?
here i am aposting my code error is in line no 11 to 15(in line no 15 i am getting error like DML requires SObject or SObject list type: lead) can you resolve it ??
public class MyLe {
public string lastName{set;get;}
public string com{set;get;}
public string leadSource{set;get;}
public string phoe{set;get;}
public void create()
{
lead le =new lead();
11) le.LastName=lastName;
12) le.Company=com;
13) le.LeadSource=leadSource;
14) le.Phone=phoe;
15) insert le;
}
}
You are getting this error because there is no standard field 'LastName' on standard Lead object which you have defined on 11th line 'le.LastName'.
Are you getting the error in runtime? can you please check if it's because your profile does not have access to Lead object?
it's already have full access to lead object.yeah while i am developing code only it is commimg like that(run time error )
Runtime: code execution time
Compile time: errors when written code is compiled (when saving the written code to Salesforce in code editor)