You need to sign in to do that
Don't have an account?
Ashmi Patel
unexpected token: Opportunity at line 6 column 53
public class op_trigger
{
public void op_check(List<Opportunity> ops)
{
Double Total_Amount = 0 ;
for(Opportunity o1 : [select amount form Opportunity where CreatedDate = Today AND CreatedByID = :UserInfo.getUserID()])
{
Total_Amount = Total_Amount + o1.Amount;
}
for(Opportunity o2 : ops)
{
Total_Amount = Total_Amount + o2.Amount;
if(Total_Amount > 1000000)
o2.addError('out of Limit');
}
}
}
{
public void op_check(List<Opportunity> ops)
{
Double Total_Amount = 0 ;
for(Opportunity o1 : [select amount form Opportunity where CreatedDate = Today AND CreatedByID = :UserInfo.getUserID()])
{
Total_Amount = Total_Amount + o1.Amount;
}
for(Opportunity o2 : ops)
{
Total_Amount = Total_Amount + o2.Amount;
if(Total_Amount > 1000000)
o2.addError('out of Limit');
}
}
}
public class op_trigger
{
public void op_check(List<Opportunity> ops)
{
Double Total_Amount = 0 ;
for(Opportunity o1 : [select amount from Opportunity where CreatedDate = Today AND CreatedByID = :UserInfo.getUserID()])
{
Total_Amount = Total_Amount + o1.Amount;
}
for(Opportunity o2 : ops)
{
Total_Amount = Total_Amount + o2.Amount;
if(Total_Amount > 1000000)
o2.addError('out of Limit');
}
}
}
You have written wrong spelling of from in the query correct it.
Hope it will help you.
Please mark it best answer if it helps.
Thanks