> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fusioncore.us/llms.txt
> Use this file to discover all available pages before exploring further.

# Locking Financial Periods

> Lock a Financial Period to freeze its ledger lines and close the accounting timeframe.

Locking is the control that protects a closed accounting timeframe. When you lock a Financial Period, fusionCore freezes every Financial Event tied to that period so nobody can retroactively alter posted transactions, then closes the period.

A **Financial Period** (`FCORE_PAY__Financial_Period__c`) is a record that represents an accounting date range you want to close out, such as a calendar month. fusionCore does not post journal entries or create debit/credit transactions itself. Instead, a Financial Period organizes and locks the supporting financial data for a timeframe so your general ledger (GL) system can import it. Locking that period is how you signal the data is final.

## How Locking Works

When you click **Lock**, fusionCore runs validations, then starts a **batch job**. On success, the job sets `Is_Locked__c = true` on the parent Financial Events and flips the period's `Status__c` to `Closed`.

Because the work runs in the background, the period does not close the instant you click the button. It closes only when the batch job finishes successfully. You can track progress in the `Batch_Job_Status__c` field on the record, which moves from `Processing Lock` to `Completed Lock`. If something fails, it shows `Lock Error` and the reason appears in the `Batch_Job_Error_Message__c` field.

## Prerequisites

* The **Lock** quick action must be added to the Financial Period record page.
* The period's `Status__c` must be `Open`. You cannot lock a period that is already `Closed`.
* You must **Fetch** the Financial Event Lines first. See [Fetching Financial Event Lines](/end-user-guides/accounting/financial-periods/fetching-financial-event-lines).

## Lock a Financial Period

<Info>
  Your Financial Event Lines must be [fetched](/end-user-guides/accounting/financial-periods/fetching-financial-event-lines) before you lock the period.
</Info>

<Steps>
  <Step title="Open the Financial Period record">
    Open a **Financial Period** record by clicking its name in the list view.

    <Frame>
      <img src="https://mintcdn.com/fusionspan/dgaf-BkijdfqhSNr/images/end-user-guides/4858249295/image-20260309-142752.png?fit=max&auto=format&n=dgaf-BkijdfqhSNr&q=85&s=9aa70ca8e7d6be88e1a34e619abe571d" alt="A Financial Period record open in Salesforce" width="630" height="549" data-path="images/end-user-guides/4858249295/image-20260309-142752.png" />
    </Frame>
  </Step>

  <Step title="Click Lock">
    At the top right-hand side of the record, click **Lock**.

    <Frame>
      <img src="https://mintcdn.com/fusionspan/dgaf-BkijdfqhSNr/images/end-user-guides/4858249295/image-20241118-201222.png?fit=max&auto=format&n=dgaf-BkijdfqhSNr&q=85&s=3036650d112a4707851d31ab1edcedb4" alt="The Lock button at the top right of a Financial Period record" width="3418" height="1720" data-path="images/end-user-guides/4858249295/image-20241118-201222.png" />
    </Frame>
  </Step>

  <Step title="Wait while the lock runs">
    A pop-up appears with a progress message while the lock batch job runs.

    <Frame>
      <img src="https://mintcdn.com/fusionspan/dgaf-BkijdfqhSNr/images/end-user-guides/4858249295/Screenshot_2024-11-18_at_2.19.27-PM-20241118-201935.png?fit=max&auto=format&n=dgaf-BkijdfqhSNr&q=85&s=171c233793388f799eabe9d99c2607b1" alt="Progress pop-up shown while the lock job runs" width="3402" height="1750" data-path="images/end-user-guides/4858249295/Screenshot_2024-11-18_at_2.19.27-PM-20241118-201935.png" />
    </Frame>
  </Step>

  <Step title="Confirm the success message">
    When the lock completes, a pop-up appears with a success message.

    <Frame>
      <img src="https://mintcdn.com/fusionspan/dgaf-BkijdfqhSNr/images/end-user-guides/4858249295/Screenshot_2024-11-18_at_2.19.37-PM-20241118-201942.png?fit=max&auto=format&n=dgaf-BkijdfqhSNr&q=85&s=9402ab4d961463dc3fd6d1b8f949742f" alt="Success pop-up shown when the lock completes" width="3420" height="1730" data-path="images/end-user-guides/4858249295/Screenshot_2024-11-18_at_2.19.37-PM-20241118-201942.png" />
    </Frame>
  </Step>

  <Step title="Refresh to confirm the locked lines">
    Click the refresh icon on the **Financial Event Lines** section. The lines now display as **Locked**.

    <Frame>
      <img src="https://mintcdn.com/fusionspan/dgaf-BkijdfqhSNr/images/end-user-guides/4858249295/Screenshot_2024-11-18_at_2.19.51-PM-20241118-202413.png?fit=max&auto=format&n=dgaf-BkijdfqhSNr&q=85&s=bce8840f9b40fdd50cae59734c641ca8" alt="Financial Event Lines section showing locked lines" width="3420" height="1740" data-path="images/end-user-guides/4858249295/Screenshot_2024-11-18_at_2.19.51-PM-20241118-202413.png" />
    </Frame>
  </Step>
</Steps>

## Limitations and Common Pitfalls

* **Locking is effectively irreversible from the record page.** Once a period is `Closed`, you cannot edit its `Start_Date__c`, `End_Date__c`, or `Status__c`, and you cannot edit or delete the locked Financial Event Lines. This package ships no "reopen" button.

* **You can only lock an Open period.** If `Status__c` is already `Closed`, the **Lock** button reports `Action is available only for Open Financial Periods.`

* **No concurrent runs.** You cannot start a second action while a fetch or lock is still running. Wait for `Batch_Job_Status__c` to reach `Completed Fetch` or `Completed Lock` before clicking again.

* **Lock runs extra pre-flight checks beyond Fetch.** Before freezing anything, fusionCore confirms every linked line's parent event succeeded inside the period's date range, that no succeeded line in the range was left unlinked, and that every linked event has a `Succeeded` status. If any check fails, the lock stops and the error message names the line that caused it.

* **The period closes only on batch success.** If the batch job errors, the period stays `Open`, `Batch_Job_Status__c` becomes `Lock Error`, and the detail appears in `Batch_Job_Error_Message__c`. Check that field if a lock does not complete.

* **Partial success is possible.** The job does not stop at the first bad row. Rows that succeed are committed even if others fail, and the period is flipped to the error status. Review the error message and re-check your lines before trying again.
