An account has multiple billing addresses, that cannot be edited

Overview

After upgrading from Everest 5 to 6 to 8, you are seeing multiple "Billing Address" for a single account, and these extra billing addresses cannot be modified or deactivated from inside Everest GUI.

Solution

These multiple billing addresses may come from a change in the behavior of how this data is being retrieved on the newest version.

Please note that Everest does not allow you to edit the address directly. To fix the issue, please update the state of the billing addresses that have an active state T to a D for all the addresses that don't match with the customer's bill code:

SELECT *
FROM   address,
       cust
WHERE  address.type = 4
       AND address.active = 'T'
       AND address.cust_code = cust.cust_code
       AND address.addr_code <> cust.billcode
       AND cust.active = 'T' 

To update the records, use the query below:

BEGIN TRANSACTION

UPDATE address
SET    active = 'D'
FROM   cust
WHERE  address.type = 4
       AND address.active = 'T'
       AND address.cust_code = cust.cust_code
       AND address.addr_code <> cust.billcode
       AND cust.active = 'T'

--if the number of affected record matched with the select command previously
COMMIT TRANSACTION

--and if not
ROLLBACK TRANSACTION 

Comments

0 comments

Please sign in to leave a comment.