You need to sign in to do that
Don't have an account?
mahesh admin 3
With the below code i am getting this error as [Compile Error: Illegal assignment from SOBJECT:Account to account at line 3 column 2]
trigger newoppurtunity on Account (after insert)
{
Account acc=Trigger.new[0];
Opportunity opp=new Opportunity();
opp.name=acc.name;
opp.stagename='yes';
opp.closedate=system.today();
opp.accountid=acc.id;
insert opp;
}
{
Account acc=Trigger.new[0];
Opportunity opp=new Opportunity();
opp.name=acc.name;
opp.stagename='yes';
opp.closedate=system.today();
opp.accountid=acc.id;
insert opp;
}
Vatsal Kothari
You code is correct, its not giving any error.
Sagar Pareek
Can you try