Lightning Web Component for Dynamic SOQL Queries in Salesforce
Component: jtSearchableCombobox
Purpose: Generic, reusable dropdown with real-time filtering
Features:
Usage Example:
<c-jt-searchable-combobox
label="Select Configuration"
placeholder="Type to search..."
options="{configOptions}"
required
onselect="{handleSelect}"
onclear="{handleClear}"
></c-jt-searchable-combobox>
API Properties:
| Property | Type | Description |
|โโโ-|โโ|โโโโ-|
| label | String | Display label |
| placeholder | String | Input placeholder text |
| options | Array | [{value, label}] |
| required | Boolean | Validation flag |
| disabled | Boolean | Disabled state |
| noResultsText | String | Message when no results |
| errorText | String | Validation error message |
Events:
| Event | Payload | Description |
|โโ-|โโโ|โโโโ-|
| select | {value, label, data} | Option selected |
| clear | none | Selection cleared |
Component: jtParameterInputs
Purpose: Auto-generate input fields from SOQL bind variables
Features:
:variable from SOQL= :var, =:var, = : varAuto-Detection:
-- SOQL Query:
SELECT Id, Name FROM Account WHERE Type = :accountType AND Industry = :industry
-- Auto-Generated Inputs:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ accountType: [____________] โน๏ธ โ
โ industry: [____________] โน๏ธ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Tooltip Example:
โน๏ธ accountType
Used in query: WHERE Type = :accountType
Component: jtQueryResults
Purpose: Advanced results display with multiple view modes
View Modes:
{
"metadata": {
"query": "SELECT Id, Name FROM Account...",
"count": 5,
"executedAt": "2025-11-30T10:30:00Z"
},
"records": [...]
}
.csv fileToggle Buttons:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [Table] [JSON] [CSV] ๐ฅ Export โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ... results ... โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Purpose: Find all references to a query configuration in code
Search Scope:
ApexClass records via SOQLJT_DataSelector.getRecords('ConfigName')Resilient Architecture:
Example Output:
โ Apex Search: Complete
โ Flow Search: Complete
Found 3 references:
Type | Name | Line
------------|-------------------------|------
Apex Class | AccountController | 45
Apex Class | OpportunityService | 128
Flow | Account_Update_Flow | N/A
Error Handling:
โ Apex Search: Complete
โ ๏ธ Flow Search: Failed
Error: Tooling API not accessible
Found 2 references (Apex only):
...
Performance Optimizations:
Purpose: Test queries in another userโs permission context
Modes:
WITH USER_MODE in SOQLSystem.runAs(selectedUser)User Selection:
Security Note:
โ ๏ธ Note: This validates user permissions but executes
with USER_MODE security. Results reflect sharing rules
and field-level security.
Purpose: Create/edit query configurations without code
Features:
FROM clauseFields: | Field | Required | Auto-Generated | Editable | |โโ-|โโโ-|โโโโโ-|โโโ-| | Label | โ Yes | No | โ Yes | | Developer Name | โ Yes | Yes (from label) | โ Yes | | Base Query | โ Yes | No | โ Yes | | Object Name | โ Yes | Yes (from query) | โ No (read-only) | | Bindings (JSON) | No | No | โ Yes |
Example Workflow:
"Active Opportunities"Active_OpportunitiesSELECT Id, Name, Amount FROM Opportunity
WHERE StageName = 'Closed Won'
Opportunity (read-only){ "stageName": "Prospecting" }
| Language | Code | Status |
|---|---|---|
| English | en |
โ Complete |
| Spanish | es |
โ Complete |
| French | fr |
โ Complete |
| German | de |
โ Complete |
| Italian | it |
โ Complete |
| Japanese | ja |
โ Complete |
| Portuguese (BR) | pt_BR |
โ Complete |
| Chinese (Simplified) | zh_CN |
โ Complete |
JavaScript Labels (labels.js):
Custom Labels (Future):
Object Translations:
Architecture:
JT_SessionIdPage to obtain API-enabled session IDWhy Visualforce Page Instead of Named Credentials?
Setup Required:
โ None! The application works automatically after installation.
Optional: Configure Platform Cache for optimal performance (see Tooling API Setup Guide)
See: TOOLING_API_OAUTH_SETUP.md for complete architecture details
Features That Consume API Calls:
| Feature | API Calls | Optimizations |
|---|---|---|
| โWhere is this used?โ (Apex) | 0 | Direct SOQL (no callouts) |
| โWhere is this used?โ (Flows) | 1-2 | โ Cached session ID + smart filtering |
| Create Configuration | 1-2 | โ Cached session ID |
| Edit Configuration | 1-2 | โ Cached session ID |
Note: With caching optimizations, session ID retrieval is reduced from N callouts to 1 callout per transaction.
Daily Limits:
Audit Logging:
JT_SettingsAuditLog__cKeyboard Navigation:
Screen Reader Support:
aria-label, aria-labelledby)aria-live)aria-required)role="combobox", role="listbox")Visual Accessibility:
Component-Specific:
| Component | Accessibility Features |
|---|---|
jtSearchableCombobox |
ARIA combobox pattern, keyboard nav, screen reader announcements |
jtQueryResults |
Table headers, row/column associations, expand/collapse announcements |
jtConfigModal |
Modal focus trap, ESC key close, required field validation |
jtExecuteButton |
Loading state announced, disabled state communicated |
Problem (v1.0): Server callout for every keystroke in search
Solution (v2.0): Filter options in browser
Impact:
Problem (v1.0): Full page re-render on any state change
Solution (v2.0): Granular component updates
Impact:
Pure Functions = Memoization
// Can safely memoize this - same input always gives same output
const transformToCSV = memoize((records) => {
return records.map((r) => Object.values(r).join(",")).join("\n");
});
Benefits:
Architecture:
jtQueryViewer (Parent)
โโ State: selectedConfig, parameters, results
โโ Passes props to children
โโ Children emit events back
Why This Works:
Components: - Deleted December 2025queryState, settingsState
Status: Never used in production, removed during code cleanup.
Current Approach:
When to Avoid:
Implementation:
// jtQueryViewer.js
errorCallback(error, stack) {
console.error('Component Error:', error);
console.error('Stack:', stack);
// Show user-friendly message
this.showToast('Warning',
'A component failed to load. Other features remain functional.',
'warning'
);
// Continue execution - don't crash entire app
}
Benefits:
Key Principle: Independent services that fail independently
Example - JT_UsageFinder:
// Service 1: Apex search (always works)
ServiceResponse apexResponse = findInApexClasses(configName);
// Service 2: Flow search (may fail due to Tooling API)
ServiceResponse flowResponse = findInFlows(configName);
// Return both, even if one failed
return new AggregatedResponse(apexResponse, flowResponse);
UI Handling:
| Breakpoint | Width | Layout |
|---|---|---|
| Mobile | < 768px | Expandable cards, stacked inputs |
| Tablet | 768px - 1024px | Hybrid (some cards, some tables) |
| Desktop | > 1024px | Full tables, side-by-side layout |
Query Results:
lightning-datatableForms:
Modals:
Test Categories:
Key Features:
Coverage by Class: | Class | Coverage | Tests | |โโ-|โโโ-|โโ-| | JT_DataSelector | 95% | 12 methods | | JT_UsageFinder | 92% | 8 methods | | JT_MetadataCreator | 88% | 6 methods | | JT_QueryViewerController | 91% | 10 methods | | JT_RunAsTestExecutor | 89% | 5 methods | | JT_ProductionSettingsController | 90% | 7 methods |
Overall: 84.5% average coverage
| Document | Language | Topic |
|---|---|---|
| README.md | EN | Overview, quick start, features |
| ARCHITECTURE.md | EN | System design, patterns, performance |
| CHANGELOG.md | EN | Version history, breaking changes |
| TOOLING_API_SETUP.md | EN | Step-by-step Tooling API setup |
| TOOLING_API_SETUP_ES.md | ES | Guรญa de configuraciรณn Tooling API |
| SEARCHABLE_COMBOBOX_USAGE.md | EN | Component API reference |
| MICROSERVICES_PATTERN.md | EN | Resilient architecture |
| TRANSLATIONS_ARCHITECTURE.md | EN | i18n implementation |
| ACCESSIBILITY.md | EN | WCAG 2.1 compliance details |
Accessible via Documentation tab, includes:
Need Help?
Want to Contribute?
Version: 2.0.0 Last Updated: 2025-11-30 License: MIT