{
  "id": "FLOW-003",
  "name": "BeforeSave in-place assignment from $Record.Account.XX (Order_Set_PLG_BD_Pool on Create)",
  "description": "RecordBeforeSave flow Order_Set_PLG_BD_Pool copies Account.PLG_BD_Pool__c into $Record.PLG_BD_Pool__c via in-place assignment. The user-supplied PLG_BD_Pool__c=false in the create payload MUST be overridden by the Account value during the insert transaction. Locks: (a) BeforeSave context marker set by FlowTriggerListener (PR #1106), (b) isInPlace=true for BeforeSave so the listener merges $Record back into the insert payload, (c) standard-relationship lazy-load works during BeforeSave phase. The Account_PLG_Id variable is a static Id of an Account known to have PLG_BD_Pool__c=true — update it per environment; in new-prod-essential the canonical Formagrid Inc record works.",
  "variables": {
    "Account_PLG_Id": "0015g00000OmZRxAAN"
  },
  "object": "Order",
  "method": "POST",
  "endpoint": "/services/data/v63.0/sobjects/Order",
  "payload": {
    "AccountId": "{Account_PLG_Id}",
    "EffectiveDate": "2026-04-17",
    "Status": "Draft",
    "StatusCode": "Draft",
    "Name": "FLOW-003-BeforeSaveCreate",
    "Archived__c": false,
    "Contain_Earlier_Termination_Clause__c": false,
    "CurrencyIsoCode": "USD",
    "Is_Stripe__c": false,
    "IsReductionOrder": false,
    "OP_Paid_via_Marketplace__c": false,
    "Order_Expiration_Alert__c": false,
    "Order_is_Terminated__c": false,
    "Order_to_be_deleted__c": false,
    "PLG_BD_Pool__c": false,
    "TotalAmount": 0
  },
  "expects": {
    "status_code": 201
  },
  "query_after": {
    "object": "Order",
    "assertions": [
      {
        "field": "AccountId",
        "operator": "eq",
        "value": "{Account_PLG_Id}"
      },
      {
        "field": "PLG_BD_Pool__c",
        "operator": "eq",
        "value": true
      }
    ]
  },
  "teardown": {
    "method": "DELETE",
    "endpoint": "/services/data/v63.0/sobjects/Order/{id}"
  },
  "priority": "P1",
  "bug_ref": "#1106",
  "scene": "flow"
}
