if($acct) { $acct->acctid( 'pv002' ); $acct->update; $acct->discard_changes; # add this }