The following sample updates an existing account record.
Date date = new Date();
protected AccountRepository accountRepository;
//for this example, it is assumed that you already know the target account record's unique key (where uniqueKey is a String variable)
AccountUpdate account = new AccountUpdate();
account.setUniqueKey(uniqueKey);
account.setName("Budget 2009 Q2");
account.setAllocated(15000.00);
account.setAllocationLimit(20000.00);
account.setUsed(5000.00);
account.setAvailable(10000.00);
account.setStartOn(date);
account.setAccountOverdraftType(AccountOverdraftType.ALLOW_NEGATIVE);
account.setType(AccountType.BUDGET);
account.setActive(true);
//setting the autoPost property to true indicates that financial transactions can post to this account;
account.setAutoPost(true);
account.setParentAccountUniqueKey("ACCT_1519");
accountRepository.updateAccount(account);