deploying-ui-bundle
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeploying a UI Bundle
部署UI Bundle
The order of operations is critical when deploying to a Salesforce org. This sequence reflects the canonical flow.
部署到Salesforce org时,操作顺序至关重要。以下流程为标准规范流程。
Step 1: Org Authentication
Step 1: Org认证
Check if the org is connected. If not, authenticate. All subsequent steps require an authenticated org.
检查org是否已连接。若未连接,则进行认证。后续所有步骤均需要已认证的org。
Step 2: Pre-deploy UI Bundle Build
Step 2: 部署前UI Bundle构建
Install dependencies and build the UI bundle to produce . Required before deploying UI bundle entities.
dist/Run when: deploying UI bundles and is missing or source has changed.
dist/安装依赖并构建UI Bundle以生成目录。部署UI Bundle实体前必须完成此步骤。
dist/执行时机:部署UI Bundle且目录缺失或源码已更改时。
dist/Step 3: Deploy Metadata
Step 3: 元数据部署
Check for a manifest ( or ) first. If present, deploy using the manifest. If not, deploy all metadata from the project.
manifest/package.xmlpackage.xmlDeploys objects, layouts, permission sets, Apex classes, UI bundles, and all other metadata. Must complete before schema fetch — the schema reflects org state.
首先检查是否存在清单文件(或)。若存在,则使用清单进行部署;若不存在,则部署项目中的所有元数据。
manifest/package.xmlpackage.xml部署对象、布局、权限集、Apex类、UI Bundle及所有其他元数据。必须在获取schema前完成此步骤——schema反映org的状态。
Step 4: Post-deploy Configuration
Step 4: 部署后配置
Deploying does not mean assigning. After deployment:
- Permission sets / groups — assign to users so they have access to custom objects and fields. Required for GraphQL introspection to return the correct schema.
- Profiles — ensure users have the correct profile.
- Other config — named credentials, connected apps, custom settings, flow activation.
Proactive behavior: after a successful deploy, discover permission sets in and assign each one (or ask the user).
force-app/main/default/permissionsets/完成部署并不意味着权限已分配。部署完成后:
- 权限集/用户组 —— 分配给用户,使其能够访问自定义对象和字段。这是GraphQL自省返回正确schema的必要条件。
- Profiles(配置文件) —— 确保用户拥有正确的配置文件。
- 其他配置 —— 命名凭据、连接应用、自定义设置、流激活。
主动操作:部署成功后,自动发现目录下的权限集并逐一分配(或询问用户)。
force-app/main/default/permissionsets/Step 5: Data Import (optional)
Step 5: 数据导入(可选)
Only if exists. Delete runs in reverse plan order (children before parents). Import uses Anonymous Apex with duplicate rule save enabled.
data/data-plan.jsonAlways ask the user before importing or cleaning data.
仅当文件存在时执行。删除操作按计划逆序执行(先删除子对象,再删除父对象)。导入使用启用重复规则保存的匿名Apex。
data/data-plan.json执行数据导入或清理前必须询问用户。
Step 6: GraphQL Schema and Codegen
Step 6: GraphQL Schema与codegen(代码生成)
- Set default org
- Fetch schema (GraphQL introspection) — writes at project root
schema.graphql - Generate types (codegen reads schema locally)
Run when: schema missing, or metadata/permissions changed since last fetch.
- 设置默认org
- 获取schema(GraphQL自省)—— 在项目根目录生成文件
schema.graphql - 生成类型(codegen从本地读取schema)
执行时机:schema缺失,或自上次获取后元数据/权限已更改时。
Step 7: Final UI Bundle Build
Step 7: 最终UI Bundle构建
Build the UI bundle if not already done in Step 2.
若Step 2中未完成UI Bundle构建,则在此步骤执行。
Summary: Interaction Order
总结:交互顺序
- Check/authenticate org
- Build UI bundle (if deploying UI bundles)
- Deploy metadata
- Assign permissions and configure
- Import data (if data plan exists, with user confirmation)
- Fetch GraphQL schema and run codegen
- Build UI bundle (if needed)
- 检查/认证org
- 构建UI Bundle(若部署UI Bundle)
- 部署元数据
- 分配权限并完成配置
- 导入数据(若存在数据计划,需用户确认)
- 获取GraphQL schema并执行codegen
- 构建UI Bundle(若需要)
Critical Rules
关键规则
- Deploy metadata before fetching schema — custom objects/fields appear only after deployment
- Assign permissions before schema fetch — the user may lack FLS for custom fields
- Re-run schema fetch and codegen after every metadata deployment that changes objects, fields, or permissions
- Never skip permission set assignment or data import silently — either run them or ask the user
- 必须在获取schema之前部署元数据——自定义对象/字段仅在部署后才会显示
- 必须在获取schema之前分配权限——用户可能缺少自定义字段的字段级安全性(FLS)权限
- 每次更改对象、字段或权限的元数据部署完成后,必须重新执行schema获取和codegen
- 不得静默跳过权限集分配或数据导入——要么执行,要么询问用户
Post-deploy Checklist
部署后检查清单
After every successful metadata deploy:
- Discover and assign permission sets (or ask the user)
- If exists, ask the user about data import
data/data-plan.json - Re-run schema fetch and codegen from the UI bundle directory
每次元数据部署成功后:
- 发现并分配权限集(或询问用户)
- 若文件存在,询问用户是否进行数据导入
data/data-plan.json - 从UI Bundle目录重新执行schema获取和codegen