sf --help // lists all top-level topics
sf org --help // lists all the topics and commands under "org"
sf org create --help // lists all the commands in the subtopic "org create"
sf org create sandbox --help // detailed info about the "org create sandbox" command
sf org create sandbox -h // quick and short info about the "org create sandbox" command
如果您在公司防火墙后面的计算机上安装或更新 Salesforce CLI,或者 Web 代理时,您有时会收到错误消息。在这种情况下,您必须进一步配置您的 系统。
当您在后面安装 Salesforce CLI 后运行命令时,您会收到此类错误 防火墙或 Web 代理。此错误来自 Linux 计算机,但 Windows 和 macOS 用户 有时会看到类似的错误。
@salesforce/cli: Updating CLI... !
▸ 'ECONNRESET': tunneling socket could not be established, cause=connect EHOSTUNREACH 0.0.23.221:8080 - Local (10.126.148.39:53107)
若要解决此问题,请从终端或 Windows 命令提示符运行以下命令。 替换为您的 Web 代理用户名和密码。如果你的 代理不需要这些值,请省略它们。此外,请替换为公司代理的 URL 和端口。username:pwdproxy.company.com:8080
npm config set https-proxy https://username:pwd@proxy.company.com:8080
npm config set proxy https://username:pwd@proxy.company.com:8080
查看使用该命令设置的局部和全局配置变量。输出列出了 从中运行命令的项目目录和所有全局变量。config list
sf config list
List Config
==========================================================
| Name Value Location
| ─────────────────── ─────────────────────────── ────────
| org-instance-url https://test.salesforce.com Local
| org-max-query-limit 20000 Local
| target-dev-hub DevHub Local
sf list
? Which of these commands do you mean (Use arrow keys)
❯ community list template Retrieve the list of templates available in your org.
env list List the environments you’ve created or logged into.
env logdrain list List log drains connected to a specified environment.
env var list List your environment's config vars in a table.
org list shape List all org shapes you’ve created.
org list snapshot List scratch org snapshots.
package installed list List the org’s installed packages.
若要缩小一长串可能的命令范围,请提供一个标志。例如,如果运行 ,则仅显示 和 命令,因为它们是唯一具有该标志的命令。sf list –allenv listorg list–all
npm ERR! code EEXIST
npm ERR! path /Users/user/.nvm/versions/node/v18.16.0/bin/sfdx
npm ERR! EEXIST: file already exists
npm ERR! File exists: /Users/user/.nvm/versions/node/v18.16.0/bin/sfdx
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2023-06-28T22_16_15_181Z-debug-0.log
运行 .exe 文件,例如双击它 Windows 资源管理器,并回答所有提示。(可选)在“选择组件”窗口中,如果需要 Microsoft Defender 防病毒软件 若要在扫描时排除已安装的 Salesforce CLI 文件,请选择“将 %LOCALAPPDATA%\sf 添加到 Windows Defender 排除项”。此选项最初被取消选择,因为我们想要默认的 Windows 安装更安全。但从防病毒扫描中排除 CLI 文件 提高了 Salesforce CLI 的性能,这就是我们为您提供选项的原因。与 关心。
安装完成后,重新启动命令提示符、PowerShell 窗口或 IDE 以确保 Salesforce CLI 可用。
警告
Salesforce CLI 在本机 Windows 命令提示符下效果最佳 (cmd.exe) 和 Microsoft Windows PowerShell。 我们不建议将 Salesforce CLI 与 Linux 终端模拟器(如 Windows 10)一起使用 适用于 Linux、cygwin 或 MinGW 的子系统,因为对 bug 的支持有限。
使用 TAR 文件安装 CLI
Salesforce CLI 分发 TAR 文件,您可以在所有受支持的操作上安装这些文件 系统。
使用此表查找适用于您的操作系统的 TAR 文件(.tar.gz 或 .tar.xz)的未版本控制 URL。当我们发布新版本时 每周,我们还会更新这些 URL,以便它们指向最新的 版本。非版本控制的 URL 对于 CI 用例特别有用。该表还包括 清单 URL,显示每个文件的版本控制 URL。
现在,您的源代码和测试源代码已推送到临时组织,请运行命令以运行 Apex 测试。apex run test
// -------------------------------------------------------------------------
// Run unit tests in test scratch org.
// -------------------------------------------------------------------------
stage('Run Tests In Test Scratch Org') {
rc = command "${toolbelt}/sf apex run test --target-org ciorg --wait 10 --result-format tap --code-coverage --test-level ${TEST_LEVEL}"
if (rc != 0) {
error 'Salesforce unit test run in test scratch org failed.'
}
}
组织授权失败后无法工作 有时,您尝试使用 Salesforce CLI 或 IDE 授权 Dev Hub 组织或临时组织,但未成功登录到该组织。端口对于杂散授权过程保持打开状态,并且您不能使用 CLI 或 IDE。若要继续,请手动结束该过程。
错误:使用者密钥已被获取 假设你在已创建连接应用的组织上运行。当您尝试将检索到的源部署到其他组织时,部署失败并显示错误。发生了什么事?project retrieve startThe consumer key is already taken
CLI 版本信息
使用以下命令可查看有关 Salesforce CLI 的版本信息。
sf plugins --core // Version of the CLI and all installed plug-ins
sf --version // CLI version
错误:未找到默认开发中心
当您尝试创建临时组织时,由于授权问题,您会看到此错误。
假设你使用该标志成功授权了开发人员中心组织。与组织关联的用户名是默认用户名 Dev Hub 用户名。然后,您可以在不使用该标志的情况下成功创建临时组织。但是,当您尝试创建一个临时组织时 再次使用相同的CLI命令时,您会收到以下错误:–set-default-dev-hub–target-dev-hub
Error (1): No default dev hub found. Use -v or --target-dev-hub to specify an environment.
sfdx-project.json has been updated.
Successfully created a package. 0HoB00000004CzHKAU
=== Ids
NAME VALUE
────────── ──────────────────
Package Id 0HoB00000004CzHKAU
更新程序包
要更新名称、描述或用户以接收 现有包,请使用此 命令。
sf package update --package "Expense App" --name "Expense Manager App" \
--description "New Description" --error-notification-username me2@devhub.org
sf package version create report --package-create-request-id 08cxx00000000YDAAY
输出显示有关请求的详细信息。
=== Package Version Create Request
NAME VALUE
───────────────────────────── ────────────────────
Version Create Request Id 08cB00000004CBxIAM
Status InProgress
Package Id 0HoB00000004C9hKAE
Package Version Id 05iB0000000CaaNIAS
Subscriber Package Version Id 04tB0000000NOimIAG
Tag git commit id 08dcfsdf
Branch
CreatedDate 2018-05-08 09:48
Installation URL
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB0000000NOimIAG
您可以在 的初始输出中找到请求 ID (08c)。sf package version create
sf package version create list --created-last-days 0
显示每个请求的详细信息,如下所示(ID 和标签被截断)。
=== Package Version Create Requests [3]
ID STATUS PACKAGE2 ID PKG2 VERSION ID SUB PKG2 VER ID TAG BRANCH CREATED DATE ===
08c... Error 0Ho...
08c... Success 0Ho... 05i... 04t... 2017-06-22 12:07
08c... Success 0Ho... 05i... 04t... 2017-06-23 14:55
在升级包版本之前,请确保在 Dev 中启用了用户权限“将包版本提升为已发布” 与包关联的中心组织。请考虑使用此用户创建权限集 权限,然后将权限集分配给相应的用户配置文件。
当您准备好发布时,请使用 .sf package version promote
sf package version promote --package "Expense Manager@1.3.0-7"
如果命令成功,则会显示一条确认消息。
Successfully promoted the package version, ID: 04tB0000000719qIAA to released.
更新成功后,查看包详细信息。
sf package version report --package "Expense Manager@1.3.0.7"
确认 Released 属性的值为 。true
=== Package Version
NAME VALUE
────────────────────────────── ───────────────────
Name ver 1.0
Alias Expense Manager-1.0.0.5
Package Version Id 05iB0000000CaahIAC
Package Id 0HoB0000000CabmKAC
Subscriber Package Version Id 04tB0000000NPbBIAW
Version 1.0.0.5
Description update version
Branch
Tag git commit id 08dcfsdf
Released true
Created Date 2018-05-08 09:48
Installation URL
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tB0000000NPbBIAW
sf package install --package "Expense Manager@1.2.0-12" --target-org jdoe@example.com
如果您已使用默认用户名设置了临时组织,请仅输入软件包版本 同上。
sf package install --package "Expense Manager@1.2.0-12"
注意
如果您定义了别名(使用参数),则 可以指定 的别名而不是用户名。-a–target-org
CLI 显示有关安装的状态消息。
Waiting for the subscriber package version install request to get processed. Status = InProgress Successfully installed the subscriber package version: 04txx0000000FIuAAM.
#!/bin/bash
# The execution of this script stops if a command or pipeline has an error.
# For example, failure to install a dependent package will cause the script
# to stop execution.
set -e
# Specify a package version id (starts with 04t)
# If you know the package alias but not the id, use sf package version list to find it.
PACKAGE=04tB0000000NmnHIAS
# Specify the user name of the subscriber org.
USER_NAME=test-bvdfz3m9tqdf@example.com
# Specify the timeout in minutes for package installation.
WAIT_TIME=15
echo "Retrieving dependencies for package Id: "$PACKAGE
# Execute soql query to retrieve package dependencies in json format.
RESULT_JSON=`sf data query -u $USER_NAME -t -q "SELECT Dependencies FROM SubscriberPackageVersion WHERE Id='$PACKAGE'" --json`
# Parse the json string using python to test whether the result json contains a list of ids or not.
DEPENDENCIES=`echo $RESULT_JSON | python -c 'import sys, json; print json.load(sys.stdin)["result"]["records"][0]["Dependencies"]'`
# If the parsed dependencies is None, the package has no dependencies. Otherwise, parse the result into a list of ids.
# Then loop through the ids to install each of the dependent packages.
if [[ "$DEPENDENCIES" != 'None' ]]; then
DEPENDENCIES=`echo $RESULT_JSON | python -c '
import sys, json
ids = json.load(sys.stdin)["result"]["records"][0]["Dependencies"]["ids"]
dependencies = []
for id in ids:
dependencies.append(id["subscriberPackageVersionId"])
print " ".join(dependencies)
'`
echo "The package you are installing depends on these packages (in correct dependency order): "$DEPENDENCIES
for id in $DEPENDENCIES
do
echo "Installing dependent package: "$id
sf package install --package $id -u $USER_NAME -w $WAIT_TIME --publish-wait 10
done
else
echo "The package has no dependencies"
fi
# After processing the dependencies, proceed to install the specified package.
echo "Installing package: "$PACKAGE
sf package install --package $PACKAGE -u $USER_NAME -w $WAIT_TIME --publish-wait 10
exit 0;
如果开发人员中心中有依赖于要传输的包的包,If you have packages in your Dev Hub which depends on the package that you-inter-transfer, 将 sfdx-project.json 文件中的 Package Dependency 部分更新为 显式指定您所依赖的传输包的 04t ID。
已解锁包的包 ID 和别名 在包生命周期中,包和包版本由 ID 或包别名标识。当您创建软件包或软件包版本时,Salesforce CLI 会根据软件包名称创建软件包别名,并将该名称存储在 sfdx-project.json 文件中。运行 CLI 命令或编写脚本以自动执行打包工作流时,通常更容易引用包别名,而不是包 ID 或包版本 ID。
NEXT 将内部版本号递增到下一个可用于包版本的版本号。如果 您不使用 NEXT,并且您也忘记更新版本号 在 sfdx-project.json 文件中,新的包版本使用相同的 number 作为以前的包版本。虽然我们不强制要求包的唯一性 版本号,每个包版本都分配有唯一的订阅者包版本 ID (以 04t 开头)。
// A namespace-visible Apex class
@namespaceAccessible
public class MyClass {
private Boolean bypassFLS;
// A namespace-visible constructor that only allows secure use
@namespaceAccessible
public MyClass() {
bypassFLS = false;
}
// A package private constructor that allows use in trusted contexts,
// but only internal to the package
public MyClass (Boolean bypassFLS) {
this.bypassFLS = bypassFLS;
}
@namespaceAccessible
protected Boolean getBypassFLS() {
return bypassFLS;
}
}
将数据导入 org-needs-data 暂存 组织,通过指定计划定义文件到数据导入 tree 命令。sf data import tree --target-org org-needs-data \ --plan sfdx-out/export-demo-Broker__c-Property__c-plan.json使用参数指定完整路径 命令生成的计划执行文件的名称。计划执行文件名始终以 -plan.json 结尾。–plandata export tree
运行不带标志的 apex run 命令以打开 交互式 shell。在提示符下,输入所有 Apex 代码;完成后按 CTRL-D。 然后,您的代码将在指定组织中的单个执行匿名请求中执行,或者 默认组织(如果未指定)。sf apex run --target-org myscratch此输出显示了执行 Apex 代码的示例system.debug (‘Hello world!’);
Start typing Apex code. Press the Enter key after each line, then press CTRL+D when finished. system.debug (‘Hello world!’); Compiled successfully. Executed successfully.
58.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO Execute Anonymous: system.debug (‘Hello world!’); 14:23:06.174 (174742273)|USER_INFO|[EXTERNAL]|0058H000005QWcE|test-ux9lpg9jyyqt@example.com|(GMT-07:00) Pacific Daylight Time (America/Los_Angeles)|GMT-07:00 14:23:06.174 (174785450)|EXECUTION_STARTED 14:23:06.174 (174792639)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex 14:23:06.174 (175417814)|USER_DEBUG|[1]|DEBUG|Hello world! 14:23:06.175 (175529797)|CUMULATIVE_LIMIT_USAGE 14:23:06.175 (175529797)|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 0 out of 100 Number of query rows: 0 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 150 Number of Publish Immediate DML: 0 out of 150 Number of DML rows: 0 out of 10000 Maximum CPU time: 0 out of 10000 Maximum heap size: 0 out of 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 0 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex push calls: 0 out of 10
sf project deploy preview --target-org DevSandbox
No conflicts found.
No files will be deleted.
Will Deploy [2] files.
Type Fullname Path
──────────── ─────────────── ──────────────────────────────────────────────────────────────────────────────
ApexClass WidgetClass force-app/main/default/classes/WidgetClass.cls-meta.xml
CustomObject WidgetObject__c force-app/main/default/objects/WidgetObject__c/WidgetObject__c.object-meta.xml
No files were ignored. Update your .forceignore file if you want to ignore certain files.
sf project retrieve preview --target-org DevSandbox
No conflicts found.
No files will be deleted.
Will Retrieve [3] files.
Type Fullname Path
──────────── ───────────────────────────────── ────
Layout GizmoObject__c-GizmoObject Layout
CustomObject GizmoObject__c
ApexClass GizmoClass
Ignored [2] files. These files won't retrieve because they're ignored by your .forceignore file.
Type Fullname Path
─────── ─────────────────────────────────── ────
Profile Admin
Profile B2B Reordering Portal Buyer Profile
sf project retrieve preview --target-org DevSandbox
No conflicts found.
No files will be deleted.
Will Retrieve [3] files.
Type Fullname Path
──────────── ───────────────────────────────── ────
Layout GizmoObject__c-GizmoObject Layout
CustomObject GizmoObject__c
ApexClass GizmoClass
Ignored [2] files. These files won't retrieve because they're ignored by your .forceignore file.
Type Fullname Path
─────── ─────────────────────────────────── ────
Profile Admin
Profile B2B Reordering Portal Buyer Profile
sf project retrieve preview
No conflicts found.
No files will be deleted.
No files will be retrieved.
Ignored [2] files. These files won't retrieve because they're ignored by your .forceignore file.
Type Fullname Path
─────── ─────────────────────────────────── ────
Profile Admin
Profile B2B Reordering Portal Buyer Profile
现在让我们看一下部署。要预览本地更改,请运行 。project deploy preview
sf project deploy preview --target-org DevSandbox
No conflicts found.
No files will be deleted.
Will Deploy [2] files.
Type Fullname Path
──────────── ─────────────── ──────────────────────────────────────────────────────────────────────────────
ApexClass WidgetClass force-app/main/default/classes/WidgetClass.cls-meta.xml
CustomObject WidgetObject__c force-app/main/default/objects/WidgetObject__c/WidgetObject__c.object-meta.xml
No files were ignored. Update your .forceignore file if you want to ignore certain files.
然后部署本地更改。部署到沙盒后,其他使用 沙盒可以看到您的更改。
sf project deploy start --target-org DevSandbox
Deploying v59.0 metadata to test-ikspctiorkzs@example.com using the v59.0 SOAP API.
Deploy ID: 0Af8D00000pNmKySAK
Status: Succeeded | ████████████████████████████████████████ | 2/2 Components (Errors:0) | 0/0 Tests (Errors:0)
Deployed Source
=====================================================================================================================
| State Name Type Path
| ─────── ─────────────── ──────────── ──────────────────────────────────────────────────────────────────────────────
| Created WidgetClass ApexClass force-app/main/default/classes/WidgetClass.cls
| Created WidgetClass ApexClass force-app/main/default/classes/WidgetClass.cls-meta.xml
| Created WidgetObject__c CustomObject force-app/main/default/objects/WidgetObject__c/WidgetObject__c.object-meta.xml
再次运行。project deploy preview
sf project deploy preview
No conflicts found.
No files will be deleted.
No files will be deployed.
No files were ignored. Update your .forceignore file if you want to ignore certain files.
sf project deploy preview --target-org DevSandbox
Conflicts [1]. Run the command with the --ignore-conflicts flag to override.
Type Fullname Path
───────── ─────────── ───────────────────────────────────────────────────────
ApexClass WidgetClass force-app/main/default/classes/WidgetClass.cls-meta.xml
No files will be deleted.
Will Deploy [1] files.
Type Fullname Path
───────── ────────── ──────────────────────────────────────────────────────
ApexClass GizmoClass force-app/main/default/classes/GizmoClass.cls-meta.xml
No files were ignored. Update your .forceignore file if you want to ignore certain files.
FSCServiceProcess 启用 Financial Service Cloud 的 Service Process Studio 功能。提供 IndustriesServiceExcellenceAddOn 和 FinancialServicesCloudStardardAddOn 许可证各 10 个席位。若要启用该功能,还必须在安装程序中打开 StandardServiceProcess 设置,并授予用户 AccessToServiceProcess 权限。
ServiceCloud 将 Service Cloud 许可证分配给您的临时组织,因此您可以选择客户与您联系的方式,例如通过电子邮件、电话、社交媒体、在线社区、聊天和短信。
ServiceCloudVoicePartnerTelephony 将 Service Cloud Voice with Partner Telephony 附加许可证分配给您的临时组织,以便您可以设置与支持的电话提供商集成的 Service Cloud Voice 联络中心。表示 1–50 之间的值。
ServiceUser 添加一个 Service Cloud 用户许可证,并允许访问 Service Cloud 功能。
SessionIdInLogEnabled 使 Apex 调试日志能够包含会话 ID。如果禁用,则在调试日志中将会话 ID 替换为“SESSION_ID_REMOVED”。
提供对 Einstein Attribution for Marketing Cloud 帐户的访问权限 婚约。Einstein Attribution 使用 AI 建模来动态分配归因百分比 到多个活动接触点。样本临时组织定义文件在启用 Einstein Attribution 之前,请确保将 和 设置为 。enableAIAttributionenableCampaignInfluence2true
同时授权开发人员中心组织和源组织。为每个组织运行此命令。sf auth web login --alias
为源组织创建组织形状。此命令启动一个异步进程,以 创建组织形状。sf org create shape --target-org <source org username/alias> Successfully created org shape for 3SRB0000000TXbnOCG.
检查 shape:create 命令的状态。sf org shape list=== Org Shapes ALIAS USERNAME ORG ID SHAPE STATUS CREATED BY CREATED DATE ────── ──────── ────────────────── ──────────── ────────── ───────────── SrcOrg me@my.org 00DB1230000Ifx5MAC InProgress me@my.org 2020-08-06您可以在状态为 : 之后使用组织形状:Active=== Org Shapes ALIAS USERNAME ORG ID SHAPE STATUS CREATED BY CREATED DATE ────── ───────── ────────────────── ──────────── ──────────── ──────────── SrcOrg me@my.org 00DB1230000Ifx5MAC Active me@my.org 2020-08-06
描述:尽管在源中启用了 DevOps Center org,从源组织的形状创建的临时组织没有 DevOps Center 启用。故意关闭 DevOps Center 组织首选项。我们要求 客户通过在临时中指示功能和设置来显式启用它 出于法律原因的组织定义文件,作为 DevOps Center 条款的一部分,以及 条件。
解决方法:将 DevOps Center 功能和设置添加到 临时组织定义文件。请参阅组织形状的临时组织定义 详。
运行 force:org:shape:list 时出错
描述:从中创建组织形状的试用组织 已过期。您可以看到以下任一错误:
ERROR running org list shape: Error authenticating with the refresh token due to: inactive user
ERROR running org list shape: Error authenticating with the refresh token due to: expired access/refresh token
Required fields are missing: [Welcome Email Template, Change Password Email Template, Lost Password Template]
解决方法:没有。
使用形状创建临时组织时出错
描述:创建临时组织时会看到此错误 使用形状。
ERROR running org create scratch: A fatal signup error occurred. Please try again.
If you still see this error, contact Salesforce Support for assistance.
解决方法:使用命令生成新形状,然后重试。org create shape
使用带字段的形状时,不会填充班次状态选择列表 服务
描述:当您从形状创建临时组织时 启用 Field Service,排班的 状态 字段选择列表为空。
解决方法:使用禁用了现场服务的组织结构,然后 在临时组织定义文件设置中启用 Field Service。
sf org create scratch --definition-file config/project-scratch-def.json --no-track-source
如果临时组织创建成功
执行时,命令 显示有关后台进程的运行信息,例如发送请求、 部署组织设置等。命令完成后,它会显示两个重要的 信息片段:组织 ID 和用户名。org create scratch
Creating Scratch Org...
RequestId: 2SRB000000CSqdEOAT (https://cbdocorg.my.salesforce.com/2SRB000000CSqdEOAT)
OrgId: 00D8I000000PhAk
Username: test-st9thgoyyyq3@example.com
✓ Prepare Request
✓ Send Request
✓ Wait For Org
✓ Available
✓ Authenticate
✓ Deploy Settings
Done
Your scratch org is ready.
您现在可以打开 组织。
sf org open --target-org test-st9thgoyyyq3@example.com
如果使用该标志设置别名,则可以 将该值用于 。–alias–target-org
sf org open --target-org MyScratchOrg
疑难解答提示
如果 create 命令遇到错误,则并不总是清楚临时组织是否 创建。在 Dev Hub 组织上发出此命令,查看它是否返回暂存组织 ID。 这证实了今天创建并由您拥有的临时组织的存在:
sf data query --query "SELECT ID, Name, Status FROM ScratchOrgInfo WHERE CreatedBy.Name = '<your name>' AND CreatedDate = TODAY" --target-org <Dev Hub org>
使用此信息可确定创建是否实际有效。例如,假设 你的名字是 Jane Doe,你为 Dev Hub 组织创建了一个名为 DevHub 的别名:
sf data query --query "SELECT ID, Name, Status FROM ScratchOrgInfo WHERE CreatedBy.Name = 'Jane Doe' AND CreatedDate = TODAY" --target-org DevHub
sf project deploy start
STATE FULL NAME TYPE FILE PATH
──────── ────────────────── ───────── ─────────────────────────────────────────────────────────────────────────────────────────────────────────
Conflict PropertyController ApexClass <dir>/force-app/main/default/classes/PropertyController.cls-meta.xml
Conflict PropertyController ApexClass <dir>/force-app/main/default/classes/PropertyController.cls
Error (1): There are changes in the org that conflict with the local changes you're trying to deploy.
sf project retrieve start
Preparing retrieve request... ⣾ Sending request to org
STATE FULL NAME TYPE FILE PATH
──────── ────────────────── ───────── ───────────────────────────────────────────────────────────────────
Conflict PropertyController ApexClass <dir>force-app/main/default/classes/PropertyController.cls-meta.xml
Preparing retrieve request... Error
Error (1): There are changes in your local files that conflict with the org changes you're trying to retrieve.
sf org create user --set-alias qa-user --target-org my-scratch
Successfully created user "1690397809_test-st9thgoyyyq3@example.com" with ID 0058I002inzvQAA for org 00D80000PhAkUAK.
See more details about this user by running "sf org user display -o 1690397809774_test-st9thgoyyyq3@example.com".
用户与特定的临时组织相关联。指定临时组织用户名或别名 在命令行中带有标志,如果它 尚未设置为默认值。如果尝试为非临时组织创建用户,则该命令将失败。–target-orgorg create user
sf org create user --set-alias qa-user --definition-file config/user-def.json
使用该命令查看与临时组织关联的用户列表。左侧的 (A) 标识 在创建临时组织时创建。org list users
sf org list users --target-org my-scratch
=== Users in org 00D80000PhAkUAK
Default Alias Username Profile Name User Id
─────── ────────── ─────────────────────────────────────────── ──────────────────── ───────────────
(A) my-scratch test-st9thgoyyyq3@example.com System Administrator 0058I002inzvQAA
qa-user 1690397809_test-st9thgoyyyq3@example.com Standard User 0058I002inzvQAA
使用命令显示有关用户的详细信息。org display user
sf org display user --target-org qa-user
Warning: This command exposes sensitive information <truncated for readability>
=== User Description
key label
──────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Username 1690397809_test-st9thgoyyyq3@example.com
Profile Name Standard User
Id 0058I002inzvQAA
Org Id 00D80000PhAkUAK
Access Token 00D8I<truncated>
Instance Url https://connect-enterprise-1121-dev-ed.scratch.my.salesforce.com
Login Url https://connect-enterprise-1121-dev-ed.scratch.my.salesforce.com
Alias qa-user
查看生成的密码和其他用户详细信息:sf org display user --target-org qa-user Warning: This command exposes sensitive information <truncated for readability> === User Description key label ──────────── ──────────────────────────────────────────────────────────────────────────────────────────────────────────────── Username 1690397809_test-st9thgoyyyq3@example.com Profile Name Standard User Id 0058I002inzvQAA Org Id 00D80000PhAkUAK Access Token 00D8I<truncated> Instance Url https://connect-enterprise-1121-dev-ed.scratch.my.salesforce.com Login Url https://connect-enterprise-1121-dev-ed.scratch.my.salesforce.com Alias qa-user Password ogihymg%lXa
您知道临时组织的实例 URL。如果你不知道,你可以查询你的开发人员 中心组织。为 例:sf data query --target-org my-dev-hub --query "SELECT SignupUsername,LoginUrl FROM ScratchOrgInfo WHERE SignupUsername='test-wvkpnfm5z113@example.com'"
sf org display --target-org my-scratch-org
Warning: This command will expose sensitive information that allows for subsequent activity using your current authenticated session.
Sharing this information is equivalent to logging someone in under the current credential, resulting in unintended access and escalation of privilege.
For additional information, please review the authorization section of the https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm
=== Org Description
KEY VALUE
─────────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Access Token <long-string>
Alias my-scratch-org
Api Version 58.0
Client Id PlatformCLI
Created By jdoe@fabdevhub.org
Created Date 2023-06-09T17:59:18.000+0000
Dev Hub Id jdoe@fabdevhub.org
Edition Developer
Expiration Date 2023-06-16
Id 00D8H0000007wprU
Instance Url https://java-connect-41-dev-ed.scratch.my.salesforce.com
Org Name Your Company
Signup Username test-gm9uud@example.com
Status Active
Username test-gm9uud@example.com