---
schema_version: "1"
id: 1b75eae643f15422114838a7c783d6851ef5b6113834c1e834824a21a20e0a41
title: BatchableContext Interface
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_interface_database_batchablecontext.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_database_batchablecontext.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: b45203c045595effecfa91302b3a0a2fbc68e05237469b6397153fbbbb193abe
description: Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex.Returns the ID of the current batch job chunk that is being processed.Returns the batch job ID.
---
# BatchableContext Interface

Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex.

## Namespace

[Database](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Database.htm "The Database namespace provides classes used with DML operations.")

#### See Also

- [Batchable Interface](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_database_batchable.htm#apex_interface_database_batchable "The class that implements this interface can be executed as a batch Apex job.")

## BatchableContext Methods

The following are methods for BatchableContext.

- **[getChildJobId()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_database_batchablecontext.htm#apex_Database_BatchableContext_getChildJobId)**  
    Returns the ID of the current batch job chunk that is being processed.
- **[getJobId()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_database_batchablecontext.htm#apex_Database_BatchableContext_getJobId)**  
    Returns the batch job ID.

### getChildJobId()

Returns the ID of the current batch job chunk that is being processed.

#### Signature

public Id getChildJobId()

#### Return Value

Type: [ID](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm#apex_methods_system_id "Contains methods for the ID primitive data type.")

### getJobId()

Returns the batch job ID.

#### Signature

public Id getJobId()

#### Return Value

Type: [ID](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_id.htm#apex_methods_system_id "Contains methods for the ID primitive data type.")