You need to sign in to do that
Don't have an account?

Error for saving: Quick start Apex: Add a method to the class trailhead code
There is problem with my developer org. A code which is just a copy paste of the code provided in trailhead: Quick start Apex: Add a method to the class. (https://developer.salesforce.com/trailhead/project/quickstart-apex/quickstart-apex-2) is not getting saved.
However we tried this code in my friends org, it got saved and she got the points.
As per Jitendra Zaa there could be a custom class in your code with name "Account", hence it might be having a conflict... If a class exists with "Account" name, delete it and try saving this new class and method.
https://developer.salesforce.com/forums/?id=906F0000000981XIAQ
Note: Always try to search the Error message, there might be a thread already related to the problem, and a solution available.. which will save your time.. Good Luck
-Nethaji
All Answers
These errors may be weird sometimes.
As per Jitendra Zaa there could be a custom class in your code with name "Account", hence it might be having a conflict... If a class exists with "Account" name, delete it and try saving this new class and method.
https://developer.salesforce.com/forums/?id=906F0000000981XIAQ
Note: Always try to search the Error message, there might be a thread already related to the problem, and a solution available.. which will save your time.. Good Luck
-Nethaji
hi all, im facing this issue, have tried deleting and recreated another of the same class but to no avail. have also checked that i've no apex class name.. any idea? :L
public static void updateOlderAccounts() {
// Get the 5 oldest accounts
Account[] oldAccounts = [SELECT Id, Description FROM Account ORDER BY CreatedDate ASC LIMIT 5];
// loop through them and update the Description field
for (Account acct : oldAccounts) {
acct.Description = 'Heritage Account';
}
// save the change you made
update oldAccounts;
}
I believe there is a line of code missing in the code box in the project.
Try this-