首页/自动化与工作流/platform-agentexchange-partner-offers-configure
P

platform-agentexchange-partner-offers-configure

by @forcedotcomv
4.4(120)

此技能用于启用或禁用Salesforce组织接收Transactable Marketplace合作伙伴优惠的偏好设置。通过Metadata API自动读写TransactableMarketplacePrivateOfferSettings,无需手动操作,确保组织正确配置合作伙伴优惠接收功能。

transactable-marketplaceorg-preferencesalesforce-configurationmetadata-apipartner-offersGitHub
安装方式
npx skills add https://github.com/forcedotcom/sf-skills --skill platform-agentexchange-partner-offers-configure
compare_arrows

Before / After 效果对比

1 组
使用前

用户需要手动搜索Salesforce文档,执行多个步骤来查询当前偏好、编写元数据文件、部署并验证,整个过程耗时且容易出错,尤其是在不熟悉Metadata API的情况下。

使用后

此技能自动查询当前状态、生成正确的元数据文件、部署到目标组织并验证变更,无需手动编写代码或查阅文档,几分钟内完成配置。

SKILL.md

Enabling Transactable Marketplace Receive Partner Offers Org Preference

This skill configures the enableTransactableMarketplaceReceivePartnerOffers org preference via the TransactableMarketplacePrivateOfferSettings Metadata API type, which controls whether a Salesforce org is eligible to receive partner offers through the Transactable Marketplace. It is required for subscriber orgs that participate in the TM partner offer flow.

Scope

  • In scope: Reading the current value of the pref, enabling or disabling it via Metadata API (TransactableMarketplacePrivateOfferSettings), and verifying the change took effect.
  • Out of scope: Creating or managing partner offer records, configuring marketplace listings, or any Apex/trigger changes related to offer processing.

Required Inputs

  • Target org alias or username: The org where the pref should be set. Ask if not provided.
  • Desired state: true (enable) or false (disable). Default: true.

Workflow

Phase 1 — Check current state

  1. Query the current preference value by running:

    sf data query -q "SELECT Preference, Value FROM OrgPreference WHERE Preference = 'TransactableMarketplaceReceivePartnerOffers'" --target-org <alias> --use-tooling-api
    

    If the record exists and Value = true, the pref is already enabled — confirm with the user before proceeding. If the query returns no rows, the pref is not yet set (defaults to false).

  2. Resolve the org's package directory to determine where to write metadata. Run this and use its output as <packageDir>:

    jq -r '.packageDirectories[0].path // "force-app/main/default"' sfdx-project.json
    

Phase 2 — Apply the preference

  1. Write the TransactableMarketplacePrivateOfferSettings metadata file — load assets/org-pref-template.md for the exact XML structure, then write the file at:

    <packageDir>/settings/TransactableMarketplacePrivateOffer.settings
    

    Set <enableTransactableMarketplaceReceivePartnerOffers>true</enableTransactableMarketplaceReceivePartnerOffers> (or false if disabling).

  2. Deploy the metadata to the target org. Before running the deploy, confirm with the user:

    • Confirmed the target org alias with the user (deploying to the wrong org is not easily reversible)
    • Confirmed the desired state (true/false) matches the user's intent
    sf project deploy start --metadata TransactableMarketplacePrivateOfferSettings --target-org <alias>
    

Phase 3 — Verify

  1. Confirm the change by re-running the Tooling API query from step 1 and verifying the Value column matches the desired state.

  2. Report to the user — see Output Expectations below.


Rules / Constraints

RuleRationale
Always query the current value before writing metadataAvoids unnecessary deploys and detects conflicting changes
Use TransactableMarketplacePrivateOfferSettings as the metadata typeThis is the concrete type registered in the platform for this pref, not the generic OrgPreferenceSettings
The settings file must be named TransactableMarketplacePrivateOffer.settingsMetadata API requires the filename to match the settings node name
Do not hardcode force-app/main/default/Always read sfdx-project.json for the actual package directory
Never deploy without confirming the org alias with the userDeploying to the wrong org is not easily reversible

Gotchas

IssueResolution
Tooling API query returns no rowsPref is unset (defaults to false). Safe to create a new settings file.
Deploy fails with INVALID_TYPEThe metadata type name is TransactableMarketplacePrivateOfferSettings — check the --metadata flag value.
Deploy succeeds but value doesn't changeAnother settings file in the project may be overriding this one. Search for other TransactableMarketplacePrivateOffer.settings files in the project.
INSUFFICIENT_ACCESS_OR_READONLY on deployUser running the deploy must have the "Modify All Data" or org preference admin permission in the target org.
Pref not visible in UIenableTransactableMarketplaceReceivePartnerOffers is not surfaced in Setup UI — the Tooling API query is the only way to verify it.
Available from API version 67.0+ onlyThe type is available from API v67.0 — deploying against an older API version will fail.

Output Expectations

After completing all phases, report:

Org: <alias>
Preference: enableTransactableMarketplaceReceivePartnerOffers
Previous value: <true|false|unset>
New value: <true|false>
File written: <packageDir>/settings/TransactableMarketplacePrivateOffer.settings
Deploy status: Success

Reference File Index

FileWhen to read
assets/org-pref-template.mdPhase 2, step 3 — use as the exact XML structure for the settings file
examples/org-preference-settings.xmlTo verify the generated file matches expected format

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量4.9K
评分4.4 / 5.0
版本
更新日期2026年10月14日
对比案例1 组

用户评分

4.4(120)
5
37%
4
43%
3
13%
2
5%
1
2%

为此 Skill 评分

0.0

兼容平台

🤖claude-code

时间线

创建2026年7月26日
最后更新2026年10月14日
🎁 Agent 知识卡片
调研问卷