---
title: "File Purges"
canonical: "https://kb.myframeworks.com.au/space/FRAM/28401558/File%20Purges"
format: markdown
---
The File Purges is a list of tasks, which are run in the background, to help you clean the transaction and log files within Frameworks. These file purges can be run as a once off, at a specific time or as a recurring schedule (Daily, Weekly, Fortnightly or Monthly). File Purges should be run on a regular basis as part of the general housekeeping routine of your system. By purging on a regular basis, your system will stay tidy and will function more efficiently. You will also be freeing up valuable disk space.

> ❌ **When purging files:**
> ❌ 
> ❌ - Caution should be exercised to avoid loss of data which may be legally required by the ATO or governing bodies.
> ❌ - Be careful not to purge too close to the current date as this will cause the loss of information that may still be required for enquiries and reporting.
> ❌ 
> ❌ **For Product Purges**: 
> ❌ 
> ❌ - Sterland strongly recommend that these purge functions are initially performed in your Demo database, and once they have been confirmed as successful, repeat the process in your Live database.
> ❌ - The deletion process is slow as it has a great deal of searching to do per product to determine its eligibility to be deleted. In an attempt to overcome this, the 'Product Group From/To' fields can be used to perform the purge on sections of the product file rather than the entire product file at once.

## Accessing the File Purges

To access one of the file purges below, perform the following:

1. Click the **Frameworks Menu**, and navigate to **System Administration > File Purges > **select the required task.

## File Purges in Frameworks

> ⚠️ **Note**: Any recommended time frames are only guidelines. Your business needs will dictate the actual requirements for the retention of data. Please backup and test regularly.

For all **File Purge **task, once the purge has been completed <span style="color: #333333">you will be notified of how many files were purged.</span>

> ✅ Refer to [Scheduled Task - Scheduling and Output ](https://sterlandsupport.atlassian.net/wiki/spaces/FRAM/pages/28402256) for more information on the **Output **tab and the **notification **of tasks.

### Purge Products

This file purge will purge all **special products** and **run-out products** which have been received on a Purchase Order before the date specified and which have been released on a Customer Order.

> ⚠️ If you enable **Inactive Products,** all products which have been inactive since the purge date will be deleted.

1. On the **Criteria **tab, you can define the following.
  - Select the products you want to purge by enabling **Special Products, Exclude Specials on Contracts, Run-out Products, Inactive Products** and/or** All Zero-stocked Products.**
  - Use the **Product Group From **and **To** fields to select a product group range.
  - In the **Days to retain* **field enter the number of days you're required to keep (Defaults to 999 days).
  - Enable the **Report** **Only** checkbox to view which Purchase Orders and Receipts will be purged up prior to performing the purge. The results will be displayed on the **Output **tab. Disable to purge the Purchase Orders and Receipts.
  - Enable the **Save Days to retain **checkbox** **to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.
3. A CSV file containing detailed information about purged products is generated.   
The error log also displays additional details for each transaction, such as the company, customer, and order, to assist with troubleshooting if needed. Additionally, products associated with completed or canceled orders can now be deleted without causing errors.

---

### Purge Product from Import

[Requires version 6.1+] 

This file purge will purge all **special products** based on a list provided by an import file.

1. In the **Import Criteria **tab, perform the following:
  1. Click the **Upload** button to open the **File Upload **window.
  2. Click **Choose file** to open the file explorer window.
  3. Navigate to the relevant commercial file and open it.
  4. Click **Upload**.

> ⚠️ - Each product in the input file that is purged will be noted in a log file and recorded in the Frameworks Audit tables.
> ⚠️ - Any product that cannot be purged for any reason will be noted in an exception report along with the reason why it could not be purged.
> ⚠️ - All Branch Stock records for that product will be purged as well, with each deleted branch stock record noted in the Frameworks Audit tables, but not noted in the log file.

2. Enable the **Report Only **checkbox to view which Purchase Orders and Receipts will be purged up prior to performing the purge. The results will be displayed on the **Output **tab. Disable to purge the Purchase Orders and Receipts.
3. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Aged Purchase Orders & Receipts

This file purge will <span style="color: #172b4d">purge aged Purchase Orders and Stock Receipts older than a specified number of days.</span>

1. On the **Criteria **tab, define the following:
  1. In the **Days to retain* **field enter the number of days you're required to keep (Defaults to 999 days).
  2. Enable **Old** **Orders** to delete any unreceipted orders which are older than the set number of days to keep.
  3. Enable **Report** **Only** to view the which Purchase Orders and Receipts will be purged up prior to performing the purge. The results will be displayed on the **Output **tab. Disable to purge the Purchase Orders and Receipts.
  4. Enable **Save Days to retain **to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge GL Accounts from Import

This file purge will purge all **GL Accounts** based on a list provided by an import file.

**GL Purge Import Format**: Company, Account Number

1. In the **Import Criteria **tab, perform the following:
  1. Click the **Upload** button to open the **File Upload **window.
  2. Click **Choose file** to open the file explorer window.
  3. Navigate to the relevant commercial file and open it.
  4. Click **Upload**.

> ⚠️ The purge task performs the same eligibility checks as manual deletion (e.g., no active transactions, no balances, not linked to product groups, branches, company definitions, asset types, or assets)

2. Enable the **Report Only **checkbox to view which GL Accounts will be purged and any errors prior to performing the purge. The results will be displayed on the **Output **tab. Disable to purge the GL Accounts.
3. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Customer Diary

This file purge will purge any non-permanent customer and supplier diary notes from Frameworks which are <span style="color: #172b4d">older than the set number of days to keep.</span>

1. In the **Days to retain* **field enter the number of days you're required to keep.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Debtor Statements

This file purge will <span style="color: #172b4d">purge historical customer statements older than a specified number of days.</span>

1. In the **Days to retain* **field enter the number of days you're required to keep (Defaults to 999 days). Enable **Save Days to retain** to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Customer Rewards

This file purge will purge all copies of Customer Rewards transactions which are dated on or before the date specified and roll balances up.

1. In the **Purge Dated **field enter the number of days you're required to keep.
2. Click **Submit **to run the task.

> ⚠️ If this is required to be run outside of business hours, ensure you schedule this as a **One time **schedule only.

---

### Sales Order Cleanup

This file purge will clear picking, void or delete **open transactions with no order lines**. This includes Quotes, Orders and Credit Notes.

1. On the **Report Criteria **tab, define the following:
  - The **Report Only** checkbox will be enabled by default. This will allow you to view which transactions will be cleaned up prior to performing the clean up. The results will be displayed on the **Output **tab. Disable to purge the transactions.
  - From the **Branch **drop-down menu select the branch you want to purge the data from. It defaults to All Branches.
  - Enable the options you want to clean up.
    - **Clear Zero Customer Transactions only?**
    - **Clear All Open Transactions**
    - **Clear Picking**
    - **Void Open Transactions**
    - **Delete Open Transitions**
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Sales and Quotes Cleanup

This file purge will clear picking, void or delete **open transactions**. This includes Quotes, Orders and Credit Notes. 

> ❌ This file purge can delete or void **ALL OPEN TRANSACTIONS.**

> ⚠️ **Important: **The following flags help to control the deletion of open transactions.
> ⚠️ 
> ⚠️ - When the **AuthDelSO** flag is enabled and the user is a **POS Supervisor**, they can successfully delete **ALL** open transactions, including transactions with order lines.
> ⚠️ - When **SopSpecDel** flag is enabled, sales order with linked PO with special products deletion is restricted.
> ⚠️ 
> ⚠️ For Example: When **AuthDelSO** is enabled and User **POS Supervisor** is disabled, Sales and Quote Cleanup can NOT delete open transactions.

1. On the **Report Criteria **tab, define the following:
  - The **Report Only** checkbox will be enabled by default. This will allow you to view which transactions will be cleaned up prior to performing the clean up. The results will be displayed on the **Output **tab. Disable to purge the transactions.
  - From the **Order Type** drop-down menu select the type of order you want cleaned up from the system. The options include **All, Quote, Order, Credit Request **or **Cash Refund.**
  - From the **Branch **dropdown select the branch you want to clean up the data for. It defaults to your currently logged in branch.
  - From the **Clean Up Type** drop-down menu select how you want to clean up the transactions, based on the report criteria defined.
    - **Delete** will delete and remove all open transactions.
    - **Void **will void all open transactions. If selected you will be able to choose a **Void Reason **applied to all the transactions.
  - Enable the option **Clear Picking **to remove picked stock on open transactions
  Below these options are addition filters to further refine the clean up.
  - From the **Customer's Sales Rep **field, enter the sales rep Id to clean up open transaction assigned to the selected sales representative for a selected customer. Click the **Search** icon to use the **Sales Rep Finder** window.
  - From the **Customer Id **field, enter the Customer Name or Id and select from the available list to clean up open transaction for the selected customer, based around other criteria. Click the
    **Search** icon to use the **Customer Finder** window.
  - Enable  the **Expired Only **checkbox to clean up only expired quotes.
  - From the **Clean Created** **Before** date field, enter a date to clean up open transaction that were created prior to the selected date.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Stock Adjustments

This file purge will purge all data from the s<span style="color: #172b4d">tock adjustment detail file which have been marked as complete and are older than the set number of days to keep.</span>

1. In the **Days to retain* **field enter the number of days you're required to keep.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Work Orders

This file purge will purge all completed work orders (headers and order lines) older than the set number of days to keep. Work Orders with **Open Linked Sales Orders** will not be purged.

> ℹ️ Recommended to keep at least 3 months (90 days) of data for enquiry purposes.

1. In the **Days to retain* **field enter the number of days you're required to keep.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Timber Packs

This file purge will purge timber packs from the system where the pack is of status **used** and the date sold or used was more than a specified numbers of days ago.

1. In the **Days to retain* **field enter the number of days you're required to keep. Enable **Save Days to retain **to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Account Payable Cheques

This file purge will <span style="color: #172b4d">purge presented cheques and direct credits where the date of the payment is more than the specified number of days old.</span>

1. In the **Days to retain* **field enter the number of days you're required to keep. Enable **Save Days to retain** to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Account Payable Invoices

This file purge will purge all paid supplier invoices out of Accounts Payable where the invoice is older than the specified number of days.

1. In the **Days to retain* **field enter the number of days you're required to keep. Enable **Save Days to retain** to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Location Movements

This file purge will purge stock movements older than the specified number of days.

1. In the **Days to retain* **field enter the number of days you're required to keep. Enable **Save Days to retain** to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Invoice Print Records

This file purge will purge all the Scheduled Invoice Output data dated on or before the specified 'days to retain'.

> ⚠️ This is required to be performed before the first time you run the [Scheduled Invoice Output ](https://sterlandsupport.atlassian.net/wiki/spaces/FRAM/pages/28382504) task.

1. In the **Days to retain* **field enter the number of days you required to keep. Enable **Save Days to retain** to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Product Tier Pricing

This file purge will purge product tier pricing once it is past the dates to retain from it's effective to date.

1. In the **Days to retain* **field enter the number of days you're required to keep (Defaults to 999 days). Enable **Save Days to retain** to save the number of days to retain value for next time.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Product Components of Cost

This file purge will purge all the expired Product Cost Components that are older than the set number of days to keep.

1. In the **Number of Days to retain* **field enter the number of days you're required to keep.
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

### Purge Scan Documents

This file purge removes all scanned invoices with the defined statuses older than the specified cutoff date. By default this task automatically clears imported invoices older than 32 days with status POSTED or SUCCEEDED. 

To run manually:

1. Enable the **Purge** checkbox
2. Select the **Type** of document to be purged. **Note:** This is currently set to be **Creditor Invoices **and the select option will become available once more document types are available.
3. From the **Status** field, enter the statuses to be purged. Use the **search **icon to select the statuses from an available list.
4. Use the **calendar **icon to select a **Cut Off** date.
5. Click **Submit **to run the task.

---

###  Purge Bounced Emails

This file purge will purge all records in the bounced email table older than the Days to Retain specified.

1. In the **Days to retain* **field enter the number of days you're required to keep (Defaults to 30 days).
2. Go to the **Schedule** tab to schedule the task as required and then click **Submit **to run the task.

---

> ✅ ## <span style="color: #172b4d">Additional Information</span>
> ✅ 
> ✅ Refer to [Scheduled Task - Scheduling and Output ](https://sterlandsupport.atlassian.net/wiki/spaces/FRAM/pages/28402256) form more information.
> ✅ 
> ✅ Refer to [Disaster Recovery for Frameworks](https://sterlandsupport.atlassian.net/wiki/spaces/FRAM/pages/28396186) for more information on ensuring your data is backed up and recoverable.