> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/administration/install-configure/remove-sdoc-events-older-than-30-days.md).

# Remove SDoc Events Older Than 30 Days

Feature available in 11.0 and further to remove old events consuming storage space within the salesforce org. Event Aggregation when enabled creates a scheduled job “S-Docs Event Aggregate Batch Job” which you can find in the scheduled jobs runs once every day (12:30 am) gathering and aggregating events older than 30 days into a new object “Event\_Aggregate\_\_c”. The new object deletes the aggregated events freeing up space.

One run of the job can delete 50 Million events in about 2000 batches.

You can also manually run the job using the new global method “ EventAggregateBatchUtil.start()”

![(blue star)](https://content.gitbook.com/content/WKNnJmhJBQwhdk5WBFsi/blobs/xKwoxvyMgXfg5kgBh6AV/1f4d8.png)\
Instructions

How to enable Event Aggregation

{% stepper %}
{% step %}

### Step 1

Navigate to S-Docs Setup page and click on “Enable Event Aggregation”<br>
{% endstep %}

{% step %}

### Step 2

Verify if the scheduled job has been created in the Scheduled Jobs section<br>
{% endstep %}

{% step %}

### Step 3

This will automatically delete old SDoc Events freeing up storage space - Setup → Storage Usage<br>
{% endstep %}
{% endstepper %}

![(blue star)](https://content.gitbook.com/content/WKNnJmhJBQwhdk5WBFsi/blobs/XbGIotlofdPBiWpbCxr6/1f4cb.png)\
Related articles

<details>

<summary>Error details</summary>

Error rendering macro 'contentbylabel' : CQL was parsed but the search manager was unable to execute the search. Error message: com.atlassian.confluence.api.service.exceptions.scale.SSStatusCodeException: There was an illegal request passed to XP-Search Aggregator API : HTTP/1.1 403 Forbidden

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sdocs.com/sdocs/administration/install-configure/remove-sdoc-events-older-than-30-days.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
