billing-schedule-setup
Use this skill to configure Salesforce Billing billing schedules, invoice plans, billing policies, and billing treatments on activated Orders. Triggers: 'billing schedule not generating invoices', 'blng__BillingSchedule__c records missing after order activation', 'how to set up in-advance vs in-arrears billing', 'configure milestone billing in Salesforce Billing', 'invoice run not picking up order products', 'evergreen billing setup', 'billing treatment configuration'. NOT for CPQ quoting, not for standard revenue schedules (OpportunityLineItem revenue schedule splits), not for Salesforce Revenue Cloud (Revenue Lifecycle Management), not for native Salesforce subscription billing without the Salesforce Billing managed package.
Best use case
billing-schedule-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use this skill to configure Salesforce Billing billing schedules, invoice plans, billing policies, and billing treatments on activated Orders. Triggers: 'billing schedule not generating invoices', 'blng__BillingSchedule__c records missing after order activation', 'how to set up in-advance vs in-arrears billing', 'configure milestone billing in Salesforce Billing', 'invoice run not picking up order products', 'evergreen billing setup', 'billing treatment configuration'. NOT for CPQ quoting, not for standard revenue schedules (OpportunityLineItem revenue schedule splits), not for Salesforce Revenue Cloud (Revenue Lifecycle Management), not for native Salesforce subscription billing without the Salesforce Billing managed package.
Teams using billing-schedule-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/billing-schedule-setup/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How billing-schedule-setup Compares
| Feature / Agent | billing-schedule-setup | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use this skill to configure Salesforce Billing billing schedules, invoice plans, billing policies, and billing treatments on activated Orders. Triggers: 'billing schedule not generating invoices', 'blng__BillingSchedule__c records missing after order activation', 'how to set up in-advance vs in-arrears billing', 'configure milestone billing in Salesforce Billing', 'invoice run not picking up order products', 'evergreen billing setup', 'billing treatment configuration'. NOT for CPQ quoting, not for standard revenue schedules (OpportunityLineItem revenue schedule splits), not for Salesforce Revenue Cloud (Revenue Lifecycle Management), not for native Salesforce subscription billing without the Salesforce Billing managed package.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Billing Schedule Setup This skill activates when a practitioner needs to configure Salesforce Billing (blng__ namespace) billing schedules, invoice plans, billing policies, or billing treatments — from initial Legal Entity setup through Invoice Run execution. It covers In-Advance, In-Arrears, Evergreen, Milestone, and Dynamic Invoice Plan schedule types. --- ## Before Starting Gather this context before working on anything in this domain: - Confirm the Salesforce Billing managed package (namespace prefix `blng__`) is installed. Salesforce Billing is a separate managed package layered on top of Salesforce CPQ — it is not part of core Salesforce or CPQ alone. - Confirm **Data Pipelines is enabled** in the org (Setup > Data Pipelines). This is a hard platform dependency: without it, the Billing package cannot create billing schedule records even if all configuration is correct. - Identify the required schedule type (In-Advance, In-Arrears, Evergreen, Milestone, or Dynamic Invoice Plan) — this determines configuration path and invoice run behavior. - Confirm the OrderProducts are CPQ-sourced (via Quote > Order flow), not manually created — manually created Orders bypass CPQ fields required by Billing. - Know the billing period (Monthly, Quarterly, Annually, Custom) and billing day-of-month required by the business. --- ## Core Concepts ### Billing Lifecycle: Order Activation Creates blng__BillingSchedule__c The Salesforce Billing lifecycle begins when an Order is activated. At activation, the Billing package creates one `blng__BillingSchedule__c` record per OrderProduct that has a valid Billing Rule reference. Each `blng__BillingSchedule__c` holds the projected charge dates and amounts for that product's billing period. These records are auto-generated — do not create them manually. The configuration chain that must be in place before Order activation: ``` Legal Entity → Billing Policy → Billing Treatment → Tax Policy → (Invoice Plan if Dynamic) ``` Each link in this chain is a lookup on the previous object. Missing any one link prevents billing schedule generation or invoice creation. ### Schedule Types and Their Behavior Salesforce Billing supports five schedule types, each controlled by the `blng__BillingType__c` field on `blng__BillingRule__c`: | Type | Invoice Timing | Manual Trigger Required | Notes | |---|---|---|---| | In-Advance | Invoice issued before service period | No | Default for most subscription SaaS | | In-Arrears | Invoice issued after service period ends | No | Calculates from actual usage period end date | | Evergreen | Rolls forward each period indefinitely | No | No end date; must explicitly cancel | | Milestone | Invoice issued at milestone completion | Yes | Admin or Apex must trigger invoice run per milestone | | Dynamic Invoice Plan | Custom date-driven schedule | No | Requires separate Invoice Plan record | The most commonly misconfigured: **Milestone billing** — practitioners expect it to fire automatically but it requires a manual Invoice Run scoped to the milestone date. ### Invoice Run: Batch Processing and Governor Limits Invoice Runs (`blng__InvoiceRun__c`) are the mechanism that aggregates `blng__BillingSchedule__c` items into `blng__Invoice__c` records. Invoice Runs execute as batch jobs, processing approximately **300 billing schedule lines per batch chunk** to stay within Salesforce governor limits. For orgs with thousands of order products, this means a single Invoice Run may spawn many batch iterations. Key Invoice Run fields: - `blng__InvoiceDate__c` — the date that appears on the invoice header - `blng__TargetDate__c` — the cutoff date; only schedule items on or before this date are processed - `blng__Status__c` — Posted, Canceled, Draft; only Draft runs can be modified ### blng__BillingSchedule__c vs blng__RevenueSchedule__c vs OpportunityLineItem Revenue Schedules These are three entirely different constructs: - `blng__BillingSchedule__c` — Salesforce Billing managed package object; one per OrderProduct; controls invoice generation - `blng__RevenueSchedule__c` — Salesforce Billing managed package object; controls revenue recognition timing (separate from billing timing) - OpportunityLineItem Revenue Schedule — standard Salesforce feature for splitting opportunity revenue; has no integration with the Billing package Do not conflate these. Enabling "Revenue Schedules" in standard Salesforce Setup is unrelated to and does not replace `blng__RevenueSchedule__c`. --- ## Common Patterns ### Pattern 1: Standard Subscription Billing (In-Advance, Monthly) **When to use:** A subscription product should invoice at the start of each monthly period. **How it works:** 1. Create a `blng__BillingRule__c` with `blng__BillingType__c = In-Advance`, `blng__BillingDayOfMonth__c = 1` (or contract start day), `blng__InitialBillingDate__c` logic set to Order Start Date. 2. Create a `blng__RevenueRecognitionRule__c` if revenue recognition is required. 3. On the Product2 record, set the `blng__BillingRule__c` lookup to the new rule. 4. Ensure a Billing Policy exists with a Legal Entity and Tax Policy attached. 5. Ensure the Billing Policy is set on the Account record (`blng__BillingPolicy__c` lookup on Account). 6. Activate the Order — `blng__BillingSchedule__c` records are created automatically. 7. Run an Invoice Run with `blng__TargetDate__c` set to today or the desired billing date. **Why not the alternative:** Manually creating `blng__BillingSchedule__c` records bypasses Billing Rule logic and produces orphaned records that Invoice Runs cannot reliably pick up. ### Pattern 2: Milestone Billing for Professional Services **When to use:** A services engagement invoices at project milestone completion (e.g., 30% at kickoff, 40% at delivery, 30% at acceptance). **How it works:** 1. Set `blng__BillingType__c = Milestone` on the `blng__BillingRule__c`. 2. Define milestone amounts on the `blng__BillingSchedule__c` child records (created at Order activation). 3. When a milestone is achieved, update the milestone record's status to indicate completion. 4. Manually trigger an Invoice Run scoped to the milestone date — the run will only process lines where the milestone status is complete and the date is on or before `blng__TargetDate__c`. **Why not the alternative:** Using In-Advance for milestone billing creates invoices on fixed calendar dates regardless of project status, violating contract terms and creating disputes. --- ## Decision Guidance | Situation | Recommended Approach | Reason | |---|---|---| | SaaS subscription, invoice before each period | In-Advance billing schedule | Matches standard subscription contract terms; invoices auto-generate | | Usage-based billing, invoice after metering | In-Arrears billing schedule | Arrears calculates from actual period end; supports usage data import | | Month-to-month with no defined end date | Evergreen billing schedule | No termination date required; rolls forward indefinitely until canceled | | Professional services with milestone gates | Milestone billing with manual Invoice Run | Prevents premature invoicing; admin controls when each invoice fires | | Complex custom schedule (variable amounts by date) | Dynamic Invoice Plan | Supports arbitrary date/amount combinations outside period-based logic | | Need to invoice multiple order products on one invoice | Single Invoice Run with shared Invoice Date | Invoice Run aggregates multiple schedule items into one blng__Invoice__c per Account | --- ## Recommended Workflow Step-by-step instructions for an AI agent or practitioner working on this task: 1. **Verify prerequisites** — Confirm Salesforce Billing (blng__) is installed, Data Pipelines is enabled, and the org has at least one CPQ-sourced Order in Draft status. Check that the Account has a `blng__BillingPolicy__c` value set. 2. **Build the configuration chain** — In order: create or confirm Legal Entity (`blng__LegalEntity__c`), then Billing Policy (`blng__BillingPolicy__c`) linked to the Legal Entity and Tax Policy, then Billing Treatment (`blng__BillingTreatment__c`) linked to the Billing Policy. Do not skip steps or reorder. 3. **Configure Billing Rules on Products** — Set `blng__BillingRule__c` on each Product2 record. Select the schedule type (In-Advance, In-Arrears, Evergreen, Milestone). Set billing period and day-of-month fields to match contract terms. 4. **Activate the Order** — Change Order Status to Activated. Confirm that `blng__BillingSchedule__c` records are created — one per OrderProduct. If records are missing, check Data Pipelines status and Billing Rule linkage. 5. **Create and submit an Invoice Run** — Create a `blng__InvoiceRun__c` with `blng__InvoiceDate__c` and `blng__TargetDate__c` set correctly. Set Status to Posted to execute. Monitor the batch job in Setup > Apex Jobs for completion. 6. **Validate invoices** — Confirm `blng__Invoice__c` records are created with correct amounts, invoice dates, and line items. Confirm `blng__BillingSchedule__c` records show the expected next billing date. 7. **For Milestone billing only** — After each milestone completes, manually trigger a scoped Invoice Run. Confirm that only the completed milestone lines are invoiced; future milestones must remain uninvoiced. --- ## Review Checklist Run through these before marking work in this area complete: - [ ] Data Pipelines is enabled in Setup (hard dependency confirmed) - [ ] Legal Entity, Billing Policy, Billing Treatment, and Tax Policy are all created and linked in the correct order - [ ] Every Product2 in scope has a `blng__BillingRule__c` lookup populated with the correct schedule type - [ ] The Account record has `blng__BillingPolicy__c` set to the correct Billing Policy - [ ] `blng__BillingSchedule__c` records were auto-generated upon Order activation (no manual records) - [ ] Invoice Run `blng__TargetDate__c` is set to capture all intended billing schedule items - [ ] Invoice Run batch completed without errors (check Setup > Apex Jobs) - [ ] `blng__Invoice__c` records show correct amounts, line counts, and invoice dates - [ ] Milestone billing: only completed milestones have been invoiced; future milestones are still pending --- ## Salesforce-Specific Gotchas Non-obvious platform behaviors that cause real production problems: 1. **Data Pipelines is a silent hard dependency** — If Data Pipelines is not enabled, the Billing package installs successfully and the UI shows no errors, but `blng__BillingSchedule__c` records are never created when Orders activate. The failure is silent — no error is thrown, no record is created. Always verify Data Pipelines is enabled before debugging any "missing billing schedule" issue. 2. **Billing Policy must be on the Account, not the Order** — Many practitioners set the Billing Policy lookup on the Order directly, expecting it to drive invoice generation. The billing engine reads `blng__BillingPolicy__c` from the Account record, not the Order. Setting it only on the Order has no effect. 3. **Invoice Run Target Date is a hard cutoff, not a range** — An Invoice Run processes all billing schedule items where the next billing date is on or before `blng__TargetDate__c`. If `blng__TargetDate__c` is set to yesterday, items scheduled for today are excluded. Practitioners expecting to invoice "through today" must set target date to today, not yesterday. 4. **In-Arrears calculates from period end, not run date** — In-Arrears billing schedule amounts are finalized based on the actual service period end date stored on the schedule item, not the date the Invoice Run executes. Running the Invoice Run early does not change the invoice amount or date — the run simply skips items whose period has not yet ended. 5. **Manually created blng__BillingSchedule__c records are not invoice-run-eligible** — The Invoice Run engine has internal validation that marks billing schedule items as engine-created. Records created via Data Loader, Flow, or Apex that bypass the Order activation trigger are treated as invalid by the Invoice Run and silently skipped. --- ## Output Artifacts | Artifact | Description | |---|---| | `blng__LegalEntity__c` record | Top of the configuration chain; required before Billing Policy can be created | | `blng__BillingPolicy__c` record | Links Legal Entity and Tax Policy; set on Account to drive billing behavior | | `blng__BillingTreatment__c` record | Child of Billing Policy; defines how the policy applies to specific billing scenarios | | `blng__BillingRule__c` record | Set on Product2; defines schedule type, billing period, and day-of-month | | `blng__BillingSchedule__c` records | Auto-generated per OrderProduct at Order activation; source of truth for invoice timing | | `blng__InvoiceRun__c` record | Triggers batch processing of billing schedule items into invoices | | `blng__Invoice__c` records | Aggregated invoice documents sent to customers | --- ## Related Skills - `admin/products-and-pricebooks` — Configure Product2 records and price book entries before Billing Rules can be applied - `admin/batch-job-scheduling-and-monitoring` — Monitor Invoice Run batch jobs in Setup > Apex Jobs and diagnose batch failures
Related Skills
shield-kms-byok-setup
Configure Shield Platform Encryption with customer-supplied (BYOK) or customer-held (Cache-Only Key Service) tenant secrets, rotate them, and recover. NOT for Classic Encryption or field masking.
slack-salesforce-integration-setup
Use this skill when setting up or troubleshooting the Salesforce for Slack managed app — including connecting a Salesforce org to a Slack workspace, configuring the three-party admin handshake, linking Slack channels to Salesforce records, enabling record preview sharing, and managing org-level limits. Triggers on: Salesforce for Slack app not connecting, Slack org connection setup, Salesforce record sharing in Slack, Slack workspace admin approval, connecting Salesforce to Slack. NOT for building custom Slack apps or Slack bots (separate development platform), not for Slack Workflow Builder Salesforce connector (use slack-workflow-builder skill), not for Flow-based Slack messaging (use flow-for-slack skill).
scheduled-erp-sync-pattern
Use when designing a recurring (15-minute / hourly / nightly) data exchange between Salesforce and an external ERP system (Oracle EBS, SAP, NetSuite, Workday, Dynamics, etc.) where Salesforce is the *initiator* and pulls or pushes deltas on a schedule. Covers the full pattern: scheduled Apex → Queueable callout chain → REST request to ERP → upsert into a staging custom object → downstream reconciliation; plus watermark management (timestamp / cursor / full-refresh modes), idempotency via External ID, retry with exponential backoff, dead-letter custom object, and the volume thresholds that should redirect you to Bulk API 2.0, Change Data Capture, or MuleSoft. Triggers: 'integration to oracle erp every 15 minutes', 'scheduled sync pattern enterprise erp', 'pull netsuite invoices into salesforce nightly', 'apex schedulable callout to sap', 'how do i sync salesforce contacts to workday hourly', 'design a polling integration to my erp'. NOT for one-shot ETL imports (use data/data-loader-bulk-api), NOT for real-time inbound from ERP via Platform Events / Pub-Sub API (use integration/platform-events-publish-subscribe), NOT for outbound *event-driven* push (use integration/change-data-capture-consumer-pattern), NOT for MuleSoft / iPaaS architecture decisions (use architect/mulesoft-vs-native-integration-decision). When the data volume routinely exceeds 10K records per cycle or sub-minute latency is required, explicitly route to the Streaming / CDC / iPaaS skills instead.
salesforce-maps-setup
Use when configuring Salesforce Maps (formerly MapAnything) — territory planning, route optimization, live tracking, geo-grid visualizations, and check-in/check-out workflows for Sales or Service field reps not on Field Service. Covers package installation order (Maps + Maps Advanced + Maps Routing/Live Tracking add-ons), the MapsTerritoryPlan / MapsAdvancedRoute / MapsLayer object family, base-data syncs (Geocoding and Routing services), and integration with Sales and Service Cloud records. Triggers: 'Salesforce Maps setup', 'MapAnything migration', 'territory planning by polygon', 'route optimization for sales reps', 'live tracking field reps', 'plot accounts on a map', 'check-in to the closest account'. NOT for Field Service Lightning territory and scheduling (use admin/fsl-scheduling-optimization-design and data/fsl-territory-data-setup) — Maps and FSL are different products. NOT for Consumer Goods Cloud retail visit planning (use admin/consumer-goods-cloud-setup) — RoutePlan/Visit objects are CG-specific. NOT for Tableau / CRM Analytics geo charts.
private-connect-setup
Configure Private Connect between Salesforce and AWS/Azure for traffic to stay on private networks. NOT for standard internet callouts.
net-zero-cloud-setup
Use this skill when configuring Salesforce Net Zero Cloud — including Scope 1/2/3 emission source modeling via the StnryAssetCrbnFtprnt / VehicleAssetCrbnFtprnt / Scope3CrbnFtprnt object families, emission factor library setup (EmssnFctr / EmssnFctrSet), DPE-driven carbon calculation jobs, supplier engagement scoring, and CSRD / ESRS / TCFD disclosure pack mapping. Triggers on: Net Zero Cloud setup, Sustainability Cloud carbon accounting, Scope 1 2 3 emissions Salesforce, emission factor library, supplier engagement Net Zero, ESG disclosure pack mapping. NOT for ESG content scoring (use Marketing Cloud), NOT for general financial reporting (use Accounting Subledger), NOT for energy-only utility billing (use Energy & Utilities Cloud).
named-credentials-setup
Named Credentials and External Credentials configuration for secure outbound callouts: per-user vs per-org authentication, legacy vs enhanced Named Credentials, external credential principal types (Named Principal, Per User, Anonymous), OAuth 2.0 and JWT flows, and credential deployment. NOT for callout code patterns, Apex HTTP implementation, or OAuth server-side flow debugging.
manufacturing-cloud-setup
Use this skill when configuring Salesforce Manufacturing Cloud — including Sales Agreement setup, Account-Based Forecasting (ABF) recalc jobs, run-rate management, Rebate Management programs, channel inventory tracking via Channel Revenue Management, and Group Membership / OrderItem-to-SalesAgreement reconciliation. Triggers on: Manufacturing Cloud setup, Sales Agreement Salesforce, account-based forecast recalculation, run rate manufacturing, rebate program setup, channel revenue management. NOT for general Sales Cloud opportunity-to-order flow (use standard Opportunity / Order), NOT for Field Service install-base management (use FSL skills), NOT for Automotive Cloud dealer modeling (use automotive-cloud-setup).
loyalty-management-setup
Use this skill when setting up or extending Salesforce Loyalty Management — including program and currency creation, tier group design, qualifying vs. non-qualifying point currency separation, DPE batch job activation, partner loyalty configuration, and member portal setup on Experience Cloud. Triggers on: Loyalty Management setup, loyalty tier setup Salesforce, qualifying points vs redemption points, DPE batch job for loyalty, partner loyalty program Salesforce, loyalty member portal. NOT for Marketing Cloud engagement program design (separate product), not for B2B loyalty via Sales Cloud (standard opportunity, not loyalty program), not for general Experience Cloud site setup (use experience-cloud-setup skill).
automotive-cloud-setup
Use this skill when setting up or extending Salesforce Automotive Cloud — including the Vehicle / VehicleDefinition data model, dealer-OEM relationship modeling via AccountAccountRelation, ActionableEvent orchestration for service campaigns and recalls, FinancialAccount lifecycle for retail-credit deals, and DriverQualification / WarrantyTerm extensions. Triggers on: Automotive Cloud setup, Salesforce Automotive Cloud data model, Vehicle vs VehicleDefinition, dealer hierarchy AccountAccountRelation, Automotive Cloud actionable events, recall campaign Salesforce. NOT for general Sales Cloud opportunity work on a vehicle product (use standard Opportunity), NOT for Manufacturing Cloud sales agreements (use manufacturing-cloud-setup), NOT for Field Service vehicle inventory (use FSL skills).
scheduled-flows
Use when designing or reviewing schedule-triggered flows for recurring automation, replacement of time-based workflow patterns, bounded record selection, idempotent processing, and escalation to Apex when volume is too high. Triggers: 'scheduled flow design', 'nightly flow job', 'time based workflow replacement', 'schedule triggered flow limits'. NOT for record-triggered scheduled paths or large-scale batch processing that should be built directly in Batch Apex.
scheduled-flow-not-running-debug
Use when a Schedule-Triggered Flow is configured but is not firing at the expected time, or appears active in Setup → Flows but never produces output. Covers where scheduled flows actually surface (Setup → Scheduled Jobs, NOT Setup → Apex Jobs), the AsyncApexJob / CronTrigger evidence trail, top causes (deactivated scheduling user, daylight-savings transitions, time-zone mismatches between scheduling user and org, fault-paths that quietly stop the schedule, daily async-Apex limit pressure), and recovery steps (re-schedule via Apex, run the flow manually with the same input, switch the scheduling user). Triggers: 'how do I schedule a flow to run every monday', 'scheduled flow not firing', 'flow scheduled but no execution', 'scheduled flow stopped working last week', 'monday 6am scheduled flow did not run after dst change'. NOT for designing a new scheduled flow's record scope or idempotency (use flow/scheduled-flows), NOT for record-triggered Scheduled Paths that don't fire (use flow/flow-time-based-patterns), NOT for general Batch Apex job monitoring (use admin/batch-job-scheduling-and-monitoring).