Clean up Standard Sales Codes
Overview
Customer-specific recurring sales lines — called Standard Sales Codes — are used to define the list of items (aka Customer Listing) expected to be ordered by each customer on a regular basis. Over time, these lists can accumulate items that are no longer relevant: items that have been blocked, sales-blocked, or simply not purchased by the customer over an extended period.
The Standard Sales Code Pruning report provides a controlled way to clean up these lists. It identifies standard sales code lines that match configurable removal criteria and, depending on your selected options, either prints a preview report or permanently deletes the identified lines.
Accessing the Report
The Standard Sales Code Pruning report is available from the Tasks area of the application. It can also be scheduled as a recurring job using the Job Queue to automate periodic maintenance.
How It Works
When the report is run, it evaluates each item line in the selected Standard Sales Codes against three independent removal criteria:
- Blocked Items — The item’s general Blocked flag is enabled.
- Sales Blocked Items — The item’s Sales Blocked flag is enabled.
- Unsold Items — The item has no sales ledger entry of type Sale recorded after a calculated cut-off date.
Lines matching any of the enabled criteria are identified for removal. You control which criteria are active through the report’s Options section.
Request Page Options
When you launch the report, a request page is displayed where you configure the pruning behavior.
Options
| Field | Description |
|---|---|
| Delete Blocked Items | When enabled, any item line whose item record has the Blocked status set will be included for deletion. |
| Delete Sales Blocked Items | When enabled, any item line whose item record has the Sales Blocked status set will be included for deletion. |
| Unsold Items Prior | A date formula (mandatory). The system calculates a cut-off date by applying this formula to the current Work Date. Any item with no sales activity recorded after that cut-off date is included for deletion. Example: entering –6M targets items with no sales in the last 6 months. The formula must result in a date in the past — a future date will be rejected. |
| Print Report | When enabled, a Word report is generated listing, per Standard Sales Code, all item lines identified for deletion. This option is automatically enabled when Delete Records is selected. |
| Delete Records | When enabled, the identified lines are permanently deleted from the Standard Sales Codes. A confirmation message is displayed before any data is removed. |
Important: The Unsold Items Prior field is mandatory. The report cannot be run without a valid date formula.
Filters
In addition to the options above, you can restrict the scope of the pruning by applying filters directly on the request page:
| Filter | Description |
|---|---|
| Standard Sales Code — Code | Limits the pruning to one or more specific Standard Sales Codes. |
| Item — No. | Limits the pruning to one or more specific items across all selected Standard Sales Codes. |
Unsold Item Detection Logic
When the Unsold Items Prior date formula is provided, the following logic is applied to each item line within the selected Standard Sales Codes:
- The Standard Sales Codes are filtered based on the Code filter entered on the request page.
- The items within those codes are filtered using the Item No. filter entered on the request page.
- For each item, the system looks up the most recent Sales entry in the item ledger.
- If the last sales posting date is before the calculated cut-off date — or if no sales entry exists at all — the item line is flagged for deletion.
Deletion Confirmation
When Delete Records is enabled, before any deletion is performed, the following confirmation message is displayed:
“This procedure will delete data’s from standards sales code, are you sure you want to delete?"
- If you confirm, the identified lines are deleted and the report shows the number of lines deleted.
- If you cancel, no data is modified.
Printed Report — Standard Sales Lines to Delete
When Print Report is enabled, the report produces a Word document titled Standard Sales Lines to Delete. For each Standard Sales Code, it lists all item lines identified for removal, with the following information:
| Column | Description |
|---|---|
| Standard Sales Code | The code of the recurring sales list from which the line is to be removed. |
| Item No. | The item number of the line identified for deletion. |
| Description | The description of the item. |
| Quantity | The quantity defined in the Standard Sales Code line. |
| Last Sales Date | The most recent date on which the item was sold to the customer, based on posted ledger entries. |
| Blocked | Indicates whether the item is blocked. |
| Sales Blocked | Indicates whether the item is sales blocked. |
The report header also displays the applied filters and the calculated cut-off date, providing a complete audit trail of the pruning run.
Scheduling as a Job Queue Entry
The Standard Sales Code Pruning report can be added to the Job Queue to run automatically at a defined frequency (for example, monthly). This allows your organization to maintain clean and up-to-date customer recurring sales lists without manual intervention.
When scheduling via Job Queue, ensure that the Delete Records option is configured appropriately, as deletions will execute without an interactive confirmation.
Important Considerations
- The Unsold Items Prior date formula must always resolve to a date on or before the current Work Date. Formulas that result in a future date are not accepted.
- Only lines of type Item in Standard Sales Codes are evaluated. Other line types (such as G/L Account or resource lines) are not affected.
- Deletion is permanent and cannot be undone through the standard interface. It is strongly recommended to run the report in Print Report mode first, review the output, and only then enable Delete Records.
- The Print Report option is automatically activated when Delete Records is selected, ensuring you always receive a record of what was deleted.