# SCHED_ProcessLoginHistory

**Class** · Group: `Schedulables`

Learn it: [Async Processing guide](/async-processing-guide)

<div class="apex-member apex-class">

```apex
global inherited sharing class SCHED_ProcessLoginHistory implements Schedulable
```

**Implements:** [Schedulable](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_system_schedulable.htm)

Scheduled job that runs daily to process login history data. Launches PROC_LoginFrequencyAggregator via the adaptive async framework using Batch Apex. Batch is required because finish() updates ScheduleSetting__c (a setup object), which must run in a separate transaction from execute()'s LoginFrequency__c DML to avoid MIXED_DML_OPERATION.

**Example**

```apex
System.schedule('Daily Login History', '0 0 2 * * ?', new SCHED_ProcessLoginHistory());
```

</div>

---

## Methods

| Method | Description |
|--------|-------------|
| global void [execute](#execute)([SchedulableContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_system_schedulablecontext.htm) context) | Executes the scheduled Apex job to process login history data. |

### execute

<div class="apex-member">

```apex
global void execute(SchedulableContext context)
```

Executes the scheduled Apex job to process login history data. Reads the watermark
from ScheduleSetting__c, builds the LoginHistory query, and dispatches processing via the
adaptive async framework.

**Parameters**

| Parameter | Type | Description |
|-----------|------|-------------|
| `context` | [SchedulableContext](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_system_schedulablecontext.htm) | Contains the job id |

**Example**

```apex
System.schedule('Daily Login History Processing', '0 0 2 * * ?', new SCHED_ProcessLoginHistory());
```

</div>
