revenue-cloud-data-model

Use this skill when querying, integrating with, or troubleshooting the native Salesforce Revenue Cloud (RLM) data model — including BillingSchedule, BillingScheduleGroup, Invoice, InvoiceLine, Payment, PaymentLineInvoice, and FinanceTransaction standard objects and their relationships. Triggers on: Revenue Cloud object relationships, BillingSchedule data model, native Revenue Cloud SOQL, FinanceTransaction object, Invoice object Revenue Cloud, PaymentLineInvoice relationship. NOT for the legacy Salesforce Billing managed package data model (blng__BillingSchedule__c, blng__Invoice__c — use billing-data-reconciliation skill for that), not for CPQ data model (SBQQ__* objects).

Best use case

revenue-cloud-data-model is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use this skill when querying, integrating with, or troubleshooting the native Salesforce Revenue Cloud (RLM) data model — including BillingSchedule, BillingScheduleGroup, Invoice, InvoiceLine, Payment, PaymentLineInvoice, and FinanceTransaction standard objects and their relationships. Triggers on: Revenue Cloud object relationships, BillingSchedule data model, native Revenue Cloud SOQL, FinanceTransaction object, Invoice object Revenue Cloud, PaymentLineInvoice relationship. NOT for the legacy Salesforce Billing managed package data model (blng__BillingSchedule__c, blng__Invoice__c — use billing-data-reconciliation skill for that), not for CPQ data model (SBQQ__* objects).

Teams using revenue-cloud-data-model 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

$curl -o ~/.claude/skills/revenue-cloud-data-model/SKILL.md --create-dirs "https://raw.githubusercontent.com/PranavNagrecha/AwesomeSalesforceSkills/main/skills/data/revenue-cloud-data-model/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/revenue-cloud-data-model/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How revenue-cloud-data-model Compares

Feature / Agentrevenue-cloud-data-modelStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use this skill when querying, integrating with, or troubleshooting the native Salesforce Revenue Cloud (RLM) data model — including BillingSchedule, BillingScheduleGroup, Invoice, InvoiceLine, Payment, PaymentLineInvoice, and FinanceTransaction standard objects and their relationships. Triggers on: Revenue Cloud object relationships, BillingSchedule data model, native Revenue Cloud SOQL, FinanceTransaction object, Invoice object Revenue Cloud, PaymentLineInvoice relationship. NOT for the legacy Salesforce Billing managed package data model (blng__BillingSchedule__c, blng__Invoice__c — use billing-data-reconciliation skill for that), not for CPQ data model (SBQQ__* objects).

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

# Revenue Cloud Data Model

This skill activates when a practitioner needs to understand or query the native Salesforce Revenue Cloud (RLM) data model — the standard objects exposed for billing, invoicing, payment, and accounting. It does NOT cover the legacy Salesforce Billing managed package (blng__* namespace) or CPQ (SBQQ__*) objects — those are separate products with separate data models.

---

## Before Starting

Gather this context before working on anything in this domain:

- Native Revenue Cloud (RLM) uses **standard Salesforce objects** with standard API names: `BillingSchedule`, `Invoice`, `Payment`, `FinanceTransaction`. These are NOT the same as the managed-package objects: `blng__BillingSchedule__c`, `blng__Invoice__c`, `blng__Payment__c`.
- `BillingSchedule` is available from **API v55.0+**. Orgs on older API versions cannot access it.
- `FinanceTransaction` is a **read-only** accounting journal entry object — it cannot be created, updated, or deleted via API. It is system-generated when an Invoice is posted or a Payment is received.

---

## Core Concepts

### Object Hierarchy: Order to Revenue

The Revenue Cloud (RLM) data model follows this primary hierarchy:

```
Order
 └─ OrderItem
     └─ BillingSchedule (created via Connect API POST after order activation)
         └─ BillingScheduleGroup (aggregates multiple BillingSchedules for Invoice grouping)
             └─ Invoice
                 └─ InvoiceLine
                     └─ PaymentLineInvoice (junction between Invoice and Payment)
                 └─ FinanceTransaction (read-only accounting journal entry)
Payment
 └─ PaymentLineInvoice
```

### BillingSchedule Object

`BillingSchedule` (API v55.0+) represents the billing timeline for a single `OrderItem`. It stores:
- Billing start and end dates
- Billing frequency (Monthly, Quarterly, Annual)
- Amount per period
- Parent `OrderItem` ID

BillingSchedules are NOT auto-created on order activation — they must be explicitly created via Connect API POST. Each asset amendment order creates a NEW BillingSchedule record (it does not update the existing one).

### BillingScheduleGroup

`BillingScheduleGroup` aggregates multiple `BillingSchedule` records for invoice grouping purposes. The grouping logic determines which billing schedule lines appear on a single Invoice. This is the object that drives Invoice generation.

### Invoice and InvoiceLine

`Invoice` represents the billing document sent to the customer. Each Invoice can have multiple `InvoiceLine` records corresponding to individual billing schedule periods. Invoice posting creates a `FinanceTransaction` (accounting journal entry).

### Payment and PaymentLineInvoice

`Payment` records track customer payments received. `PaymentLineInvoice` is a junction object linking a Payment to one or more Invoices it covers (partial payment support).

### FinanceTransaction (Read-Only Ledger)

`FinanceTransaction` records are system-generated read-only accounting journal entries. They are created automatically when:
- An Invoice is posted (creates revenue recognition entries)
- A Payment is received (creates cash receipt entries)

They cannot be created, updated, or deleted via Apex DML or REST API. Any code attempting to DML a FinanceTransaction will throw a system exception.

---

## Common Patterns

### Pattern 1: Query All Billing Schedules for an Order

**When to use:** Audit or integration requiring all billing timeline records for a given order.

```sql
SELECT Id, OrderItemId, StartDate, EndDate, Status, BillingFrequency, Amount,
       BillingScheduleGroupId, CreatedDate
FROM BillingSchedule
WHERE OrderItem.OrderId = 'order_id_here'
ORDER BY StartDate ASC
```

**Why this query:** BillingSchedule has a lookup to OrderItem, not directly to Order. Use the relationship traversal `OrderItem.OrderId` to filter by Order.

### Pattern 2: Trace Invoice to Finance Transactions

**When to use:** Accounting integration requiring the journal entries generated by an invoice.

```sql
SELECT Id, InvoiceId, TransactionType, Amount, AccountingPeriodId, CreatedDate
FROM FinanceTransaction
WHERE InvoiceId = 'invoice_id_here'
```

**Why not DML FinanceTransaction:** These are read-only system records. Accounting integrations must read them, not write to them. Write accounting data to your external ERP, not back into FinanceTransaction.

### Pattern 3: Reconcile Billing Schedules Across Asset Amendments

**When to use:** An asset has been amended multiple times, each creating a new BillingSchedule. Aggregate all schedules for total billed amount.

```sql
SELECT OrderItem.Product2Id,
       SUM(Amount) totalBilled,
       COUNT(Id) scheduleCount
FROM BillingSchedule
WHERE OrderItem.Order.AccountId = 'account_id'
  AND Status = 'Active'
GROUP BY OrderItem.Product2Id
```

**Why needed:** Each amendment creates a new BillingSchedule rather than updating the existing one. Without aggregation, the billing picture appears fragmented.

---

## Decision Guidance

| Situation | Recommended Approach | Reason |
|---|---|---|
| Query billing schedules | SELECT from BillingSchedule (standard API name) | RLM uses standard objects, not blng__* |
| Create billing schedule via code | Connect API POST, not DML | BillingSchedules require Connect API — direct DML may not work for all fields |
| Read accounting journal entries | SELECT from FinanceTransaction | Read-only — no DML allowed |
| Legacy Salesforce Billing data model | billing-data-reconciliation skill | Separate product, different object names |
| Invoice grouping logic | Examine BillingScheduleGroup configuration | Controls which billing lines appear on a single Invoice |

---

## Recommended Workflow

1. Confirm the org uses native Revenue Cloud (RLM), not CPQ + Salesforce Billing — verify by checking for standard `BillingSchedule` object (not `blng__BillingSchedule__c`) in the object list.
2. Verify API version is v55.0+ in org settings — `BillingSchedule` is not accessible in earlier API versions.
3. Map the object hierarchy: Order → OrderItem → BillingSchedule → BillingScheduleGroup → Invoice → InvoiceLine → FinanceTransaction.
4. For queries: use standard Salesforce SOQL with the standard API object names.
5. For billing integration: read BillingSchedule and Invoice records via REST or SOQL; publish to ERP via outbound callout or Platform Events.
6. For FinanceTransaction: read only. Never attempt DML. Reconcile FinanceTransaction data with ERP on read.
7. For amendment reconciliation: aggregate BillingSchedule by Product2Id and AccountId to get total billed amount across lifecycle.

---

## Review Checklist

- [ ] Org confirmed as native Revenue Cloud (RLM) — not Salesforce Billing managed package
- [ ] API version set to v55.0+ for BillingSchedule access
- [ ] SOQL uses standard API names (BillingSchedule, not blng__BillingSchedule__c)
- [ ] FinanceTransaction access is read-only — no DML attempted
- [ ] Amendment billing aggregation accounts for multiple BillingSchedule records per asset
- [ ] PaymentLineInvoice junction queried for partial payment scenarios
- [ ] No blng__* or SBQQ__* objects referenced in RLM queries or code

---

## Salesforce-Specific Gotchas

1. **Standard Object Names vs. Managed Package Names** — The most common error is writing SOQL against `blng__BillingSchedule__c` in an RLM org (or the reverse). `BillingSchedule` (standard) and `blng__BillingSchedule__c` (managed package) are completely different objects. SOQL that targets the wrong object returns zero results or a "no such column" error.

2. **FinanceTransaction Cannot Be DML'd** — Any Apex or API attempt to insert, update, or delete a FinanceTransaction throws a system exception. These are system-generated read-only ledger records. Accounting integrations must export FinanceTransaction data to ERP — they cannot write back.

3. **BillingSchedule Requires API v55.0+** — If code targets an older API version (e.g., v51.0), the BillingSchedule object is not accessible. This causes describe calls to return null and SOQL to fail with "object not found" errors. Always verify API version compatibility.

4. **Amendment Creates New BillingSchedule, Not Update** — When an asset amendment order is activated, a new BillingSchedule record is created for the amendment period. The original BillingSchedule is NOT updated. Queries that look only at the latest BillingSchedule for an OrderItem will miss historical billing periods from earlier lifecycles.

5. **BillingScheduleGroup Controls Invoice Grouping** — Invoice generation is driven by BillingScheduleGroup, not directly by BillingSchedule. If multiple billing schedules should appear on a single invoice, they must be assigned to the same BillingScheduleGroup. Misconfiguration results in separate invoices per billing schedule line.

---

## Output Artifacts

| Artifact | Description |
|---|---|
| Revenue Cloud data model diagram | Visual: Order → OrderItem → BillingSchedule → BillingScheduleGroup → Invoice → FinanceTransaction |
| SOQL query library | Queries for BillingSchedule, Invoice, FinanceTransaction, PaymentLineInvoice with correct API names |
| Amendment reconciliation query | Aggregation of BillingSchedule records across asset lifecycle for correct total billing view |
| ERP integration data map | Field mapping from Revenue Cloud standard objects to common ERP schemas |

---

## Related Skills

- revenue-lifecycle-management — for DRO fulfillment and order-to-cash workflow using these objects
- revenue-cloud-architecture — for architectural design of the full order-to-cash domain
- billing-data-reconciliation — for legacy Salesforce Billing managed package (blng__*) data model

Related Skills

sandbox-data-masking

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring or reviewing Salesforce Data Mask to protect PII/PHI in partial or full copy sandboxes after a refresh. Trigger keywords: data mask, sandbox masking, PII in sandbox, GDPR sandbox, HIPAA non-production, mask contacts, obfuscate fields non-production. NOT for sandbox refresh mechanics (use sandbox-refresh-and-templates), NOT for production data anonymization, NOT for Shield Platform Encryption at rest.

gdpr-data-privacy

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when implementing GDPR or CCPA data privacy controls in Salesforce: Individual sObject linkage, consent tracking, Right to Be Forgotten (RTBF) requests, data subject request handling, and Privacy Center configuration. Trigger keywords: GDPR, data privacy, consent management, right to erasure, Individual object, ContactPointConsent, ShouldForget, data subject request, Privacy Center, data portability. NOT for general data quality cleanup, duplicate management, field-level encryption (see platform-encryption skill), or sandbox data masking (see sandbox-data-masking skill).

experience-cloud-security

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when configuring access controls, sharing, or site security for authenticated or guest Experience Cloud (community) users: external OWD, Sharing Sets, Share Groups, CSP, clickjack protection, guest user record access. NOT for internal sharing model configuration (use sharing-and-visibility).

data-classification-labels

8
from PranavNagrecha/AwesomeSalesforceSkills

Classify Salesforce fields by data sensitivity and compliance category using the four built-in classification attributes (SecurityClassification, ComplianceGroup, BusinessOwnerId, BusinessStatus). Covers Metadata API deployment, Tooling API querying, and Einstein Data Detect recommendations. NOT for data masking, Shield Platform Encryption, or runtime access control enforcement.

customer-data-request-workflow

8
from PranavNagrecha/AwesomeSalesforceSkills

Implement GDPR/CCPA data subject rights (access, deletion, rectification) using Salesforce Privacy Center and/or custom workflow. NOT for general backup or org-level data retention policy.

omnistudio-deployment-datapacks

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when exporting, importing, or version-controlling OmniStudio components using DataPacks via the OmniStudio DataPacks tool or vlocity CLI. Covers DataPack export/import, Git version control integration, CI/CD for OmniStudio. NOT for SFDX-based metadata deployment of non-OmniStudio components.

omnistudio-asynchronous-data-operations

8
from PranavNagrecha/AwesomeSalesforceSkills

Use Integration Procedures queues, DataRaptor Chain, and Remote Actions with async patterns for long-running OmniStudio flows. NOT for simple DataRaptor reads.

dataraptor-transform-optimization

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when DataRaptor Transform operations are slow, hit governor limits, or use Apex where formula fields would suffice. Covers formula vs Apex expressions, bulk transform sizing, and chained transform composition. Triggers: 'dataraptor transform slow', 'dataraptor formula vs apex', 'dataraptor bulk transform', 'dr governor limit'. NOT for DataRaptor Extract or Load performance.

dataraptor-patterns

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing or reviewing OmniStudio DataRaptors, especially Extract versus Turbo Extract versus Transform versus Load, field mapping strategy, performance tradeoffs, and when to move work into Integration Procedures or Apex. Triggers: 'DataRaptor Extract', 'Turbo Extract', 'DataRaptor Load', 'DataRaptor Transform', 'OmniStudio data mapping'. NOT for overall OmniScript journey design or Integration Procedure sequencing when the main question is not the DataRaptor shape itself.

lwc-datatable-advanced

8
from PranavNagrecha/AwesomeSalesforceSkills

Advanced lightning-datatable patterns — inline edit + draftValues, custom cell types via extending LightningDatatable, sortable columns, infinite scroll with onloadmore, row-level errors, and the cost of large data sets. NOT for read-only display of small lists (plain lightning-datatable suffices) or fully custom grids (use a third-party library).

lwc-data-table

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing or reviewing `lightning-datatable` usage in Lightning Web Components, including column configuration, stable `key-field` values, inline editing, row actions, infinite loading, and custom cell types. Triggers: 'lightning datatable inline edit', 'row actions in lwc datatable', 'key field missing', 'infinite loading in datatable'. NOT for highly custom virtualized grids or broad page-performance work outside the datatable boundary.

lwc-custom-datatable-types

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when you need to extend `lightning-datatable` with custom cell renderings: status pills, progress bars, image thumbnails, action cells, editable pickliststo, rich-text, or any column that `lightning-datatable` does not ship out of the box. Triggers: 'custom cell type lightning datatable', 'progress bar column', 'image column', 'inline edit picklist in datatable', 'rich text column'. NOT for basic datatable usage (see `lwc-data-table`) and NOT for tree-grid or large-dataset virtualization (see `virtualized-lists`).