This basically is a housekeeping exercise followed by delete.
You have to make sure there is nothing open for the customer you want to delete otherwise you are going to get the error.
Also you can delete history for each of the customers in question, if you no longer need it (legal financial retention periods).
So first step is to void or delete any transactions for the customers in question that are in the sales work tables if you are using sop.
Also make certain there are no RM transactions open for them either.
Then you can record a macro and "mail merge" in the customer numbers you want to delete, to automate step through each customer deleting them.
However the macro will fall over if there is any reason the customer can't be deleted, that becomes a PIA, so checking everything is in good condition first is a good idea.
Macros can be used to delete the historical data for these customers too. This kind of task makes me nervous and I would run it on a copy of the test company first then run on production once everyone is happy its done what was required.
There is also a good product called company archive that is useful for trimming down data in GP, this automates a lot of these processes.
"Company Data Archive (CDA) is an ideal way to move historical information from your ‘live’ company to an ‘archive’ company. Archiving your data will reduce the size of your live company database and improve system performance while posting, running reports, performing file maintenance, and day-to-day use of Dynamics GP."
Tim.