Back to blog
Use real QuoteModel data for faster QCP development and tests
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:
- Enter a Quote Id (15 or 18 characters).
- 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:
- Pull your QCP scripts into
src/ - Fetch a QuoteModel that reproduces the bug
- Add temporary logging or guardrails in your QCP
- Diff, push, and re-test in the org
3) Build unit tests (recommended)
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:
