using-salesforce-archive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSalesforce Archive
Salesforce Archive
Operate Salesforce Archive (also called Trusted Services Archive) through its Connect API and the job-metadata object. This skill covers how to search and restore archived records, run the analyzer, handle RTBF erasure and PII masking, check storage, and — the part most often missed — how to read archive job status from and use a job's Id + Type to download its logs.
ArchiveActivityArchiveActivity通过其Connect API和任务元数据对象操作Salesforce Archive(也称为Trusted Services Archive)。本Skill涵盖如何搜索和恢复归档记录、运行分析器、处理RTBF擦除和PII掩码、检查存储,以及最常被忽略的部分——如何从读取归档任务状态,并使用任务的Id + Type下载其日志。
ArchiveActivityArchiveActivityScope
范围
- In scope: Calling the Archive Connect API operations under ; querying the
/platform/data-resilience/archive/object via SOQL/Connect; correlating a job'sArchiveActivityrecord with its log-download endpoints; the verify-after-write pattern for each async operation.ArchiveActivity - Out of scope: Defining archive policies / metadata; building UI; generating Flows over archive data (
ArchivePolicyDefinitionis not Flow-queryable — see Gotchas); generic backup/export tooling unrelated to the add-on.ArchiveActivity
- 包含范围:调用下的Archive Connect API操作;通过SOQL/Connect查询
/platform/data-resilience/archive/对象;将任务的ArchiveActivity记录与其日志下载端点关联;每个异步操作的写后验证模式。ArchiveActivity - 排除范围:定义归档策略/元数据;构建UI;基于归档数据生成Flow(
ArchivePolicyDefinition不支持Flow查询——参见注意事项);与该附加组件无关的通用备份/导出工具。ArchiveActivity
Required Inputs
必要输入
Gather or infer before acting:
- Operation intent: search, view, unarchive, analyze, mask, RTBF, storage check, or job-status/log lookup.
- Target sObject (): required for search and unarchive.
sobjectName - Filters: search and unarchive require + at least one filter.
sobjectName - For log downloads: the (an
requestIdId,ArchiveActivityprefix) of a completed, log-producing job, and8qv…= that activity'sreportType.Type
Preconditions (confirm or surface to the user if a call returns a not-permitted error):
- The org must have Salesforce Archive enabled (the /
TrustedServicesArchiveorg permission). Every operation is gated on this first.TrustedServicesArchiveBt - Each operation requires a specific user permission on top of the org gate — see the Permissions table below. There is no single "archive admin" role; access is per-capability.
在执行操作前收集或推断:
- 操作意图:搜索、查看、恢复归档、分析、掩码、RTBF、存储检查,或任务状态/日志查询。
- 目标sObject():搜索和恢复归档操作必填。
sobjectName - 筛选条件:搜索和恢复归档需要+ 至少一个筛选条件。
sobjectName - 日志下载:已完成且生成日志的任务的(
requestIdId,前缀为ArchiveActivity),以及8qv…= 该活动的reportType。Type
前置条件(如果调用返回未授权错误,请确认或告知用户):
- 组织必须已启用Salesforce Archive(拥有/
TrustedServicesArchive组织权限)。所有操作都以此为首要前提。TrustedServicesArchiveBt - 每个操作除了组织权限外,还需要特定的用户权限——参见下方的权限表。不存在单一的“归档管理员”角色;访问权限按功能划分。
Permissions
权限
Every operation first requires the org to have Salesforce Archive enabled ( = ). On top of that org gate, each capability is gated by a distinct user permission. A call the user isn't permitted for fails with a "not permitted" error — match the error to the missing permission below.
hasTrustedServicesArchiveOrgPermissions.TrustedServicesArchive || TrustedServicesArchiveBt| Operation | User permission required |
|---|---|
| |
| |
| |
| |
| |
| |
| |
Source of truth: the Connect API resource classes in→trusted-services-archive-connect-implguards →TrustedServicesArchiveSdkImpl. NoteTrustedServicesArchive.accessChecks.xmlroutes throughsearch-archived-records(gated byperformArchiverGlobalSearch=canRunArchiveSearch); the separate Apex-SDKViewSearchPagemethod is gated bysearchArchivedRecords(), but the Connect API search endpoint does not use it.ViewArchivedRecords
所有操作首先要求组织已启用Salesforce Archive( = )。在此基础上,每个功能都受独立的用户权限限制。用户无权限执行的调用会返回“未授权”错误——请将错误与下方缺失的权限匹配。
hasTrustedServicesArchiveOrgPermissions.TrustedServicesArchive || TrustedServicesArchiveBt| 操作 | 所需用户权限 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
权威来源:中的Connect API资源类 →trusted-services-archive-connect-impl守卫 →TrustedServicesArchiveSdkImpl。注意TrustedServicesArchive.accessChecks.xml通过search-archived-records路由(受performArchiverGlobalSearch=canRunArchiveSearch限制);独立的Apex-SDKViewSearchPage方法受searchArchivedRecords()限制,但Connect API搜索端点不使用该方法。ViewArchivedRecords
Workflow
工作流程
All steps are sequential within a task. Read the referenced file the first time you touch that area.
-
Identify the operation and read the contract — do not rely on general knowledge of the Archive API, which has non-obvious contracts. Loadfor the exact request/response shape, required inputs, and per-operation gotchas of every Archive Connect API operation. Do this before constructing any call (e.g.
references/connect-api-operations.mdplural vs singular,dateRangesflag vs HTTP status,isSuccessmeaning no log).url: null -
For job status / monitoring, read the data model — when the task involves archive jobs, failures, progress, counts, or logs, loadfor the
references/archive-activity-entity.mdfield reference and how it links to the Connect API. QueryArchiveActivityvia SOQL or Connect — not Flow. For a worked end-to-end example (find failed/in-progress jobs, then pull their execution-detail and failed-records logs), loadArchiveActivity.examples/monitor-failed-jobs.md -
Construct and send the call — follow the contract exactly. For searches, supply+ ≥1 filter; for date filtering use the plural
sobjectNamearray ofdateRangeswith full ISO-8601 datetimes.{field, from, to} -
Branch on the right signal — some operations return HTTP 201 with a body-level success flag (,
body.statusCode). Readbody.isSuccessfor which signal to trust per operation; never assume the HTTP status alone means success.references/connect-api-operations.md -
Verify after every write — re-read state to confirm the effect (see the Verify-After-Write table below). Async operations (analyzer, RTBF, masking) return a request id you must poll.
所有步骤在任务内按顺序执行。首次接触相关领域时请阅读参考文件。
-
确定操作并阅读契约——不要依赖对Archive API的一般认知,其契约存在非显而易见的细节。加载获取每个Archive Connect API操作的确切请求/响应格式、必要输入和各操作的注意事项。在构建任何调用前完成此步骤(例如
references/connect-api-operations.md复数与单数的区别、dateRanges标志与HTTP状态的区别、isSuccess表示无日志)。url: null -
任务状态/监控需阅读数据模型——当任务涉及归档任务、失败、进度、计数或日志时,加载获取
references/archive-activity-entity.md字段参考及其与Connect API的关联方式。通过SOQL或Connect查询ArchiveActivity——不要使用Flow。如需端到端示例(查找失败/进行中的任务,然后获取其执行详情和失败记录日志),请加载ArchiveActivity。examples/monitor-failed-jobs.md -
构建并发送调用——严格遵循契约。搜索操作需提供+ ≥1筛选条件;日期筛选使用复数
sobjectName数组,格式为dateRanges,包含完整ISO-8601日期时间。{field, from, to} -
根据正确信号分支处理——部分操作返回HTTP 201状态码并带有体级成功标志(、
body.statusCode)。阅读body.isSuccess了解每个操作应信任的信号;切勿仅通过HTTP状态码判断成功。references/connect-api-operations.md -
每次写入后验证——重新读取状态以确认操作效果(参见下方的写后验证表)。异步操作(分析器、RTBF、掩码)会返回请求ID,需轮询该ID。
Verify-After-Write
写后验证
| After this write | Confirm by |
|---|---|
| Poll |
| Re-run |
| Poll |
| Poll |
| 执行写入操作后 | 验证方式 |
|---|---|
| 轮询 |
| 重新运行 |
| 使用返回的 |
| 使用返回的 |
Rules / Constraints
规则/约束
| Constraint | Rationale |
|---|---|
Search & unarchive require | The controller rejects an unfiltered request with "Search must be based on at least 1 field" — a full-object operation is never allowed. |
Date filters must be full ISO-8601 datetimes ( | A date-only value ( |
Search uses | They are genuinely different fields on the two endpoints; using the wrong shape silently drops the filter or 400s. |
Stop pagination when | Calling |
Log downloads need a real | The backend resolves the log by the activity record; a mismatched |
| Never use the deprecated lookups | |
| Excluded objects are not retrievable | |
Query | |
| 约束 | 原因 |
|---|---|
搜索与恢复归档需要 | 控制器会拒绝未过滤的请求,提示“搜索必须基于至少一个字段”——绝不允许全对象操作。 |
日期筛选必须使用完整ISO-8601日期时间( | 仅日期值( |
搜索使用 | 这两个端点确实使用不同的字段;使用错误格式会导致筛选条件被静默忽略或返回400错误。 |
当 | 使用 |
日志下载需要真实的 | 后端通过活动记录解析日志; |
| 切勿使用已弃用的查询方式 | |
| 排除对象不可检索 | |
通过SOQL/Connect查询 | |
Gotchas
注意事项
| Issue | Resolution |
|---|---|
| Treating HTTP 201 as success | Several operations return 201 with a body-level outcome. Branch on |
| It is always |
| |
Log | |
Misreading | |
Expecting | It is not Flow-enabled ( |
| Hitting unarchive caps | Unarchive processes ≤1000 matched records per request and ≤50 requests/hour/org, and restores the whole archived hierarchy of each match. |
| RTBF/masking caps | |
| 问题 | 解决方案 |
|---|---|
| 将HTTP 201视为成功 | 多个操作返回201状态码但带有体级结果。请根据 |
使用 | 该值始终为 |
| |
因状态码为201而认为日志 | |
误读 | |
期望在Flow中使用 | 它不支持Flow( |
| 达到恢复归档上限 | 恢复归档操作每个请求最多处理1000条匹配记录,每个组织每小时最多50个请求,且会恢复每个匹配记录的整个归档层级。 |
| RTBF/掩码上限 | |
Output Expectations
输出预期
This is a knowledge/API skill — it produces API calls and their interpreted results, plus SOQL against . It does not generate deployable metadata. Deliverables per task: the correct operation invocation(s), the right success-signal branching, and a verify-after-write confirmation.
ArchiveActivity这是一个知识/API Skill——它生成API调用及其解释结果,以及针对的SOQL查询。它不生成可部署的元数据。每个任务的交付物:正确的操作调用、正确的成功信号分支处理,以及写后验证确认。
ArchiveActivityReference File Index
参考文件索引
| File | When to read |
|---|---|
| Before constructing any Archive Connect API call — full per-operation contracts, success signals, and limits |
| For any job-status / failure / progress / log task — |
| To follow an end-to-end monitoring flow: find failed/in-progress jobs, then download their logs |
| 文件 | 阅读时机 |
|---|---|
| 构建任何Archive Connect API调用前——包含各操作的完整契约、成功信号和限制 |
| 处理任何任务状态/失败/进度/日志任务时—— |
| 遵循端到端监控流程时:查找失败/进行中的任务,然后下载其日志 |