Loading
Salesforce Help 사이트 “Help Agent powered by Fin” 도입 안내더 많이 읽기
Tableau 고객 대상: Tableau를 이용하는 고객이 Help 사이트에서 사례(케이스)를 등록할 수 없는 경우의 대체 수단더 많이 읽기
Slack 관련 문의처가 Salesforce Help로 통합 및 변경됩니다.더 많이 읽기

How to Deal with the Behavior of Replacing Hard-Coded Organization IDs in Formulas When Creating or Refreshing a Sandbox

게시 일자: Dec 11, 2025
상세 설명

When you create or refresh a Salesforce Sandbox, Salesforce automatically replaces the Organization ID with a new, unique ID for that Sandbox. If a Flow contains a hard-coded 15-digit Organization ID, for example inside a Decision element, that value is automatically overwritten with the new Sandbox's Organization ID.

This is expected Salesforce platform behavior, designed to prevent a Flow from unintentionally processing production-only logic inside a Sandbox environment.

솔루션

This article explains why a hard-coded Organization ID inside a Flow changes after a Sandbox is created or refreshed, and how to build a formula resource so the Flow can still correctly detect whether it is running in production.

Why the Organization ID Changes

As a Salesforce specification, the Organization ID is replaced with a new unique ID every time a Sandbox is created or refreshed. When a 15-digit Organization ID is written directly into a Flow, for example in a Decision element, Salesforce automatically substitutes the new Sandbox's Organization ID in its place. This is normal behavior and is designed to prevent unintentional processing in the production environment.

How to Prevent the Organization ID from Being Replaced

To prevent the Organization ID replacement from breaking your logic, and to correctly identify the production environment, create a formula resource in Flow Builder and use it in a Decision element. This method compares only the last 13 characters of the Organization ID, which are not affected by the Sandbox ID replacement.

  1. In Flow Builder, click New Resource in the Toolbox.
  2. For Resource Type, select Formula and enter an API Name.
  3. For Data Type, select Boolean.
  4. In the Formula field, enter the following formula:
    IF( RIGHT( $Organization.Id , 13)="DXXXXXXXXXXXX" , true, false)
    This formula checks whether the last 13 characters of the current environment's Organization ID match your production Organization ID. Replace "DXXXXXXXXXXXX" with the last 13 characters of your production Organization ID, excluding the leading "00".
  5. Click Done.
  6. In a Decision element, configure the outcome to check whether the formula resource equals `{!$GlobalConstant.True}`.

Result

With this formula resource in place, the Flow can correctly determine whether it is currently running in the production environment, even after a Sandbox is created or refreshed and the Organization ID is replaced. This prevents values from being accidentally changed or production-only logic from running inside a Sandbox.

추가 자원

Servers and IDs

RIGHT

Knowledge 기사 번호

005134850

 
로드 중
Salesforce Help | Article