• Naresh Ramisetty
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Challenge Not yet complete... here's what's wrong: 
The 'Accounts' class 'onApplyDefaults' method does not appear to be setting the Description field to 'Domain classes rock!' correctly for a default value.
public override void onApplyDefaults() 
	{
        List<Account> updatedAccounts = new List<Account>();
        
        for (Account acct : (List<Account>)Records) {
                acct.Description = 'Domain classes rock!';
                updatedAccounts.add(acct);
        }
        
        fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(new Schema.SObjectType[] { Account.SObjectType });
        uow.registerDirty(updatedAccounts);
        uow.commitWork();
    }

Any recommendations or suggestions would be greatly appreciated.