---
schema_version: "1"
id: df4af2937b681e316729636c725a62ffab31e5a10eabd07110be0e6f364422c7
title: Create Consent Records with an Apex Job for Customer Health Verification Form
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/vaccine_packages_create_consent_records_hv.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.vaccine_packages_create_consent_records_hv.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 75c0f85ab1eb4e48ee0ce1db02df3369a360f3569586f07d0fcb186fb728c4da
description: With a scheduled Apex job, you can regularly create consent records for the COVID-19 health verifications that are generated after a customer completes the COVID-19 health verification form. Simply schedule the job, and it runs at the specified time when new health verification records are created.
products:
  - Salesforce Platform
release: "264"
---
# Create Consent Records with an Apex Job for Customer Health Verification Form

With a scheduled Apex job, you can regularly create consent records for the COVID-19 health verifications that are generated after a customer completes the COVID-19 health verification form. Simply schedule the job, and it runs at the specified time when new health verification records are created.

The job uses the schedulable class `AsyncConsentRecordCreator`to create the consent records for the Health Verification records. 

Each batch performs these actions on health verification records:

- Fetch Health Verification records with `IndividualId__c = null.`.
- If the record has `HasNotificationConsent__c = true`:
    1. Create an Individual record.
    2. Create a Contact Type Consent record.
    3. Update the Health Verification record with `IndividualId__c`.

To create a scheduled Apex job:

1. From Setup, in the Quick Find box, enter Apex Classes and then select **Apex Classes**.
2. Click **Schedule Apex**.
3. Enter the job name. We recommend Consent Record Creation, so you know what kind of record the job creates.
4. Enter AsyncConsentRecordCreator in the search bar and select it.
5. Specify the start and end dates for the Apex scheduled class. If you specify a single day, the job runs only once.
6. Specify a preferred start time. The exact start time depends on service availability.
7. Save your changes.

After the job is completed, you can see its information on the [Apex Jobs](https://help.salesforce.com/articleView?id=code_apex_job.htm&language=en_US) page, such as whether it passed or failed, how long it took to process, and the number of records processed.