-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
8Questions
-
4Replies
Trigger for the opportunity
Don't want the user to enter a future close date, if they do opportunities with past closed should be entered
- Albert Raul
- May 19, 2023
- Like
- 0
- Continue reading or reply
Help me with the error.
public class FindOpp {
public static void function(){
Date sDate = Date.today().addMonths(-1);
Date eDate = Date.today();
List<Account> accList = [SELECT Id, Name, (SELECT Id FROM Opportunity WHERE IsClosed = true AND StageName = 'Closed Won' AND CloseDate >= :sDate AND CloseDate <= :eDate) FROM Account];
List<Account> AccountData = new List<Account>();
for (Account acc : accList) {
if (acc.Opportunities.size() >= 10) {
AccountData.add(acc);
}
}
for (Account acc : AccountData) {
system.debug(acc.Name);
}
}
}
ERROR at Row:1:Column:34 Didn't understand relationship 'Opportunitiy' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
public static void function(){
Date sDate = Date.today().addMonths(-1);
Date eDate = Date.today();
List<Account> accList = [SELECT Id, Name, (SELECT Id FROM Opportunity WHERE IsClosed = true AND StageName = 'Closed Won' AND CloseDate >= :sDate AND CloseDate <= :eDate) FROM Account];
List<Account> AccountData = new List<Account>();
for (Account acc : accList) {
if (acc.Opportunities.size() >= 10) {
AccountData.add(acc);
}
}
for (Account acc : AccountData) {
system.debug(acc.Name);
}
}
}
ERROR at Row:1:Column:34 Didn't understand relationship 'Opportunitiy' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
- Albert Raul
- May 17, 2023
- Like
- 0
- Continue reading or reply
- Albert Raul
- May 10, 2023
- Like
- 0
- Continue reading or reply