# RECORD Templates Each template is a verified shape from a passing test fixture. Copy, then change names/values. --- ## RECORD — Basic RLS (record field = user attribute) Source: `conditionRLSValidSteelthread` (first condition), `conditionStandardIdRLSValidSteelthread` > **RLS MDAPI round-trip is fragile in real orgs.** Deploy/retrieve can fail with opaque gacks if a DMO field in `` is not mapped in the org's data streams. Build the rule in the UI first; use MDAPI templates as verification shapes, not first-try authoring. See §8.3 of policy.md. ```xml Read RECORD_POLICY_RULE_DEFINITION Permit StandardFieldSet3 testDMO__dlm INTERNAL ANY RECORD DATACLOUD 0 WHEN EQUALS RECORDFIELD testDMO__dlm:name__c USER_ID 1 ``` For literal-value RLS (e.g. `record.field == 'X'`), use `X` instead of ``. --- ## RECORD — RLS via PROJECTION Join Source: `conditionRLSValidSteelthread` (second condition) ```xml WHEN EXISTS EXPRESSION PROJECTION 1 testDMO__dlm test 1 EQUALS testDMO__dlm:name__c resource testDMO__dlm age__c ```