You need to sign in to do that
Don't have an account?
Aishwarya P 4
The 'updateOlderAccounts' method did not update account records as expected
public class OlderAccountsUtility
{
public static void updateOlderAccounts()
{
List<Account> lstacc = [SELECT ID,Description FROM Account ORDER BY CreatedDate ASC LIMIT 5];
for(Account acc : lstacc)
{
acc.Description = 'Heritage Account';
}
try
{
update lstacc;
}
catch(exception e)
{
}
}
}
when i execute this code it is giving an error:
"Challenge Not yet complete... here's what's wrong:
The 'updateOlderAccounts' method did not update account records as expected "
PLease help me with this
{
public static void updateOlderAccounts()
{
List<Account> lstacc = [SELECT ID,Description FROM Account ORDER BY CreatedDate ASC LIMIT 5];
for(Account acc : lstacc)
{
acc.Description = 'Heritage Account';
}
try
{
update lstacc;
}
catch(exception e)
{
}
}
}
when i execute this code it is giving an error:
"Challenge Not yet complete... here's what's wrong:
The 'updateOlderAccounts' method did not update account records as expected "
PLease help me with this
1) https://developer.salesforce.com/forums/?id=906F0000000DCoXIAW
2) https://developer.salesforce.com/forums/?id=906F0000000BaFQIA0
Let us know if this will help you
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 3 with id 0018Y00002x6iJ4QAI; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Account number must be 8 characters long.: []
Any ideas why? Do I have t ocreate a custom object first? I am just following instructions? Seems simple but?