Skip to content
Back to blog

Use real QuoteModel data for faster QCP development and tests

Fetch QuoteModel JSON into /data, reproduce edge cases locally, and build unit tests for your QCP scripts.

QCP logic is easiest to debug when you can reproduce issues with real quote data. CPQ DevKit™ for Salesforce can fetch a QuoteModel and save it locally as JSON.

1) Fetch a QuoteModel into your workspace

Run:

  • CPQ DevKit™ for Salesforce: Get QuoteModel record from Salesforce and save locally

Then:

  1. Enter a Quote Id (15 or 18 characters).
  2. Choose a filename (must end in .json).

The file is saved under data/ in your workspace (example: data/a1j...AAM.json).

2) Use QuoteModel JSON for local debugging

Common workflow:

  1. Pull your QCP scripts into src/
  2. Fetch a QuoteModel that reproduces the bug
  3. Add temporary logging or guardrails in your QCP
  4. Diff, push, and re-test in the org

If you add a simple test runner (Mocha/Chai is a common choice), you can import:

  • your QCP module from src/
  • a QuoteModel JSON from data/

If your QCP uses the conn parameter, you can also create a JSforce connection in tests using a local .env file (keep it out of Git).

Example .env keys used by many JSforce helpers:

bash
loginUrl=https://test.salesforce.comusername=you@example.compassword=your-passwordapiToken=your-token