forcedotcom/sf-skills

service-omni-service-channel-configure

Use to ensure exactly one ServiceChannel exists on a Salesforce org for a routable sObject (Case | Incident | MessagingSession | VoiceCall), reusing any standard or custom channel already bound to that sObject and only deploying a canonical template when no…

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/forcedotcom/sf-skills --skill service-omni-service-channel-configure

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

service-omni-service-channel-configure

Ensure exactly one ServiceChannel is present for a routable sObject, reusing whatever is already bound (Salesforce standard or a pre-existing custom channel) and deploying the skill's canonical v66 template only when none exists. Salesforce enforces one ServiceChannel per RelatedEntity, so the skill detects first and never deploys blindly — deploying a second channel for an sObject that already has one fails with "This Salesforce object is already in use by another Service channel." It handles one sObject per call; callers configuring multiple sObjects invoke it once for each sObject, after service-omni-base-settings-configure has enabled Omni-Channel.

sObjectStandard channel (if any)Canonical asset
CaseCasesCases.serviceChannel-meta.xml
Incidentnone (Incident Management sObject)Incidents.serviceChannel-meta.xml — deployed on first run
MessagingSessionsfdc_livemessageMessagingSessions.serviceChannel-meta.xml — deployed only if the standard channel is missing
VoiceCallsfdc_phoneVoiceCalls.serviceChannel-meta.xml — deployed only if the standard channel is missing

Inputs

bash
bash scripts/deploy-and-report.sh <org-alias> [Case|Incident|MessagingSession|VoiceCall]
  • org-alias (required).
  • sobject_type (optional, default Case) — one of Case | Incident | MessagingSession | VoiceCall.

Preconditions and safety

  • Target org authenticated via sf CLI (My Domain URL), Service Cloud license, sf CLI ≥ 2.139.6.
  • Omni-Channel base settings enabled (service-omni-base-settings-configure) — ServiceChannel is only queryable/writable when enableOmniChannel=true; a INVALID_TYPE on deploy means base settings are off.
  • Incident requires the Incident Management feature enabled; MessagingSession requires Enhanced Messaging. The skill verifies EntityDefinition first and blocks with a click-path when the target sObject is absent.

Run

deploy-and-report.sh performs the prereq check, discovery, and (only when needed) deploy, then emits the report:

  1. Prereq — confirm the target sObject is queryable via EntityDefinition; block with a click-path otherwise.
  2. Discover — query the Tooling API for a ServiceChannel with RelatedEntity = <sobject_type>. ServiceChannel is a Tooling entity on v66; the standard Data API returns INVALID_TYPE. A hit means reuse.
  3. Deploy (only when nothing was found) — sf project deploy start of the canonical XML (Cases | Incidents | MessagingSessions | VoiceCalls); a Changed state is created, Unchanged is reused.

Behavior

Detect-then-reuse-or-deploy. Because Salesforce rejects a second channel per RelatedEntity, deploy-first is unsafe: an operator who renamed the standard Cases channel would hit the "already in use" error instead of gracefully reusing. Tooling discovery is fast and returns both the reuse decision and the discovered DeveloperName in one call. The trade-off is that the skill cannot tell "our canonical shape matches" from "some custom channel is bound" — an operator with a non-canonical channel gets reused and their channel is left untouched (v1 never overwrites operator state).

Capacity model. The canonical assets use TAB_BASED for every variant. STATUS_BASED requires companion fields whose full schema is undocumented, so it is out of scope; per-agent capacity tuning belongs to PresenceUserConfig.Capacity, not this skill.

Concurrency. If a deploy fails with "already in use," another process created the channel between discovery and deploy; the skill soft-fails and a re-run reuses it.

Output contract

A single JSON object per invocation with status ∈ created | reused | blocked, plus sobject_type, channel_developer_name, channel_id, channel_origin, target_capacity_model, target_related_entity_type, before_state, deploy_id, manual_actions, and blocking_issue.

  • reused — an existing channel was found (discovery hit, or a deploy returned Unchanged).
  • created — no channel existed; the canonical XML deployed with Changed.
  • blocked — the sObject is not on the org, base settings are off (INVALID_TYPE), or a race left the channel already in use.
  • channel_origin is one of salesforce_standard (an sfdc_* name or Cases), canonical_asset (a shipped asset name), canonical_template (freshly deployed this run), or custom (a pre-existing org-specific channel).
  • channel_id is populated whenever a channel exists (null on blocked); deploy_id is populated only on the deploy branch; blocking_issue is non-null only when status: blocked.

Limitations

  • One sObject per invocation.
  • Only Case, Incident, MessagingSession, VoiceCall are supported — extend by adding an assets/force-app/main/default/serviceChannels/<Name>.serviceChannel-meta.xml file and a dispatcher branch.
  • Always reuses an existing channel; it does not reset a mis-configured channel to canonical shape.

References

FileWhen to read
references/api-notes.mdOn unexpected discovery results, deploy failures, or sObject-specific schema questions

Verwandte Aufgaben

aus demselben Repository

Weitere Skills

Alle Skills
forcedotcom
Community

platform-custom-application-generate

Use this skill when users need to create or configure tab-based Salesforce Custom Applications with navigation, branding, and action overrides. Trigger when users mention custom apps, application metadata, app navigation, or organizing tabs into applications. Use when users want to create app containers for tabs and pages. Do NOT use when the goal is hosting a React UI bundle in the App Launcher — use experience-ui-bundle-custom-app-generate for that case.

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.
forcedotcom
Community

platform-custom-field-generate

Use when users create, generate, or validate Salesforce Custom Field metadata. Trigger on custom fields, field types, Roll-Up Summary, Master-Detail/Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from a field, or scoping picklist values per record type; also field deployment errors, including a record type that won't deploy without a business process. DO NOT TRIGGER for creating/customizing the value set itself — a new GlobalValueSet o

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.
forcedotcom
Community

platform-custom-metadata-type-generate

Use to create, generate, or validate Salesforce Custom Metadata Type metadata — the mdt object, fields, and deployable records. Trigger on custom metadata types, CMDT, mdt objects, .md-meta.xml files, or cross-org reference/config data; also admin-maintained mapping/lookup/crosswalk tables (config that changes without a deploy belongs in a CMDT, never hardcoded in Apex/Flow), and CMDT deploy errors. DO NOT TRIGGER for Custom Settings (use platform-custom-setting-generate), business-record object

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.
forcedotcom
Community

platform-custom-report-type-generate

Use to create, generate, or validate Salesforce Custom Report Type metadata. Trigger on custom report types, CRTs, cross-object reports, report builder data sources, exposing fields for reporting across related objects, inner vs outer joins in reports, report type categories, or deployment errors for .reportType-meta.xml files. Do NOT trigger for running, editing, or filtering existing reports; creating report folders, dashboards, or list views; or non-authoring reporting questions.

Installationen
1
GitHub Stars
1112
Aktualisiert
23. Okt.