Salesforce SOQL to Veeva VQL Cheat Sheet: Migrating Legacy Veeva CRM Queries
As commercial IT teams migrate from legacy Salesforce-based Veeva CRM to native Veeva Vault CRM ahead of the December 2029 end-of-support deadline, every middleware job, ETL script, and portal integration using SOQL must be rewritten in VQL (Vault Query Language).
This cheat sheet covers the exact syntax mappings and gotchas you will encounter when translating SOQL to VQL.
Interactive Companion Tool: Paste any legacy SOQL query and convert it to formatted VQL with migration warnings using our Salesforce SOQL to Veeva VQL Converter.
1. SOQL vs. VQL Quick Mapping Table
| Feature | Salesforce SOQL | Veeva Vault VQL |
|---|---|---|
| Standard Veeva Objects/Fields | Call2_vod__c, Status_vod__c |
call2__v, status__v |
| Relationship Joins | Account_vod__r.Name |
account__vr.name__v |
| Row Limit | LIMIT 200 |
MAXROWS 200 |
| Pagination Offset | OFFSET 100 |
SKIP 100 (or next_page) |
| All Fields | FIELDS(ALL) |
Not supported — list fields explicitly |
| Security Enforcement | WITH SECURITY_ENFORCED |
Enforced automatically per Vault session |
2. Example: Legacy Call Query to Native VQL
Before (Salesforce SOQL):
SELECT Id, Name, Account_vod__r.Name, Status_vod__c
FROM Call2_vod__c
WHERE Status_vod__c = 'Submitted_vod'
ORDER BY Call_Date_vod__c DESC
LIMIT 200
After (Veeva Vault VQL):
SELECT
id,
name__v,
account__vr.name__v,
status__v
FROM call2__v
WHERE status__v = 'submitted__v'
ORDER BY call_date__v DESC
MAXROWS 200
3. SOQL Features That Require Manual Review in VQL
- Date Literals (
TODAY,LAST_N_DAYS:30): Replace Salesforce date literals with explicit ISO 8601 dates (YYYY-MM-DD) or Vault date functions. MAXROWSvs.PAGESIZEOrder: In VQL,MAXROWSmust always appear beforePAGESIZE.- Pagination: Prefer following
responseDetails.next_pageover largeSKIPoffsets.
Related Tools & Guides
- Tool: Salesforce SOQL to Veeva VQL Converter
- Tool: Veeva VQL Formatter & Linter
- Tool: Veeva CRM → Vault CRM Migration Planner
- Tool: Veeva Vault API Pagination Calculator
- Guide: Veeva Vault CRM vs. Legacy Veeva CRM: Migration Guide
- Hub: All Veeva Tools
