You need to sign in to do that
Don't have an account?
siva sai 22
how to resolve "DML requires SObject or SObject list type: Opportunity" at line no 16
Hi friends i am getting error while i am inserting..here i am posting my code can you please reslove this
public class Opportunity {
public string name{set;get;}
public string closedate{set;get;}
public string stagename{set;get;}
public boolean isprivate{set;get;}
public integer amount{set;get;}
public void create ()
{
Opportunity opp = new Opportunity();
opp.Name= name;
opp.CloseDate=closedate;
opp.IsPrivate=isprivate;
opp.Amount=amount;
16) insert opp;
}
}
thanks & Regards
krishna
public class Opportunity {
public string name{set;get;}
public string closedate{set;get;}
public string stagename{set;get;}
public boolean isprivate{set;get;}
public integer amount{set;get;}
public void create ()
{
Opportunity opp = new Opportunity();
opp.Name= name;
opp.CloseDate=closedate;
opp.IsPrivate=isprivate;
opp.Amount=amount;
16) insert opp;
}
}
thanks & Regards
krishna
Class named: "Test" or any standard object (Account, Contact, Opportunity ..) fool the compiler.
public class Opportunity {public class MyOpportunity {
Regards
Thanks.
I need one more help "Variable does not exist: Phone" and "Variable does not exist: LeadSource" please reslove me
public class MyLead {
public integer annualRevenue{set;get;}
public string phone {set;get;}
public string lastName{set;get;}
public string leadSource {set;get;}
public string indus{set;get;}
public void create()
{
Lead a =new Lead();
a.Phone=phone;
a.LeadSource = leadSource;
}
}
The error you see is for another source code also opened like a Visualforce page.
The code above is correct (syntax) but that must be an apex class.
Regards