Loading

Volunteer jobs missing from Report Hours dropdown in Volunteers for Salesforce when active job count exceeds 999

게시 일자: Jul 15, 2026
상세 설명

In Volunteers for Salesforce (V4S), the Volunteer Report Hours page is rendered by the managed Apex controller VOL_CTRL_VolunteersReportHours. The listSOVolunteerJobs method that populates the Volunteer Job dropdown contains a hardcoded LIMIT 999 in its SOQL query:

SELECT Name, Id FROM GW_Volunteers__Volunteer_Job__c
WHERE GW_Volunteers__Campaign__r.IsActive = true
AND GW_Volunteers__Inactive__c = false
ORDER BY Name LIMIT 999

When an org accumulates more than 999 qualifying active Volunteer Jobs (IsActive = true on the parent Campaign, and GW_Volunteers__Inactive__c = false on the Job), jobs that sort alphabetically at or after position 999 are silently truncated and will not appear in the dropdown for volunteers.
This issue can appear gradually and without warning as new jobs and campaigns accumulate over time.
To confirm this is a LIMIT issue, run the following two queries in Setup > Developer Console > Query Editor:
Query 1 — Total qualifying jobs:

SELECT COUNT(Id) jobCount
FROM GW_Volunteers__Volunteer_Job__c
WHERE GW_Volunteers__Campaign__r.IsActive = true
AND GW_Volunteers__Inactive__c = false

Query 2 — Jobs sorted before the missing job:

SELECT COUNT(Id) jobsBefore
FROM GW_Volunteers__Volunteer_Job__c
WHERE GW_Volunteers__Campaign__r.IsActive = true
AND GW_Volunteers__Inactive__c = false
AND Name < 'Your Missing Job Name Here'

If jobCount >= 999 and jobsBefore >= 999, the job is being truncated by the LIMIT.

솔루션

Short-term fix (no code changes required): Reduce the count of qualifying active jobs below 999.

  1. Identify campaigns with an End Date older than 6 months and set IsActive = false on those Campaign records.
  2. Identify stale Volunteer Jobs that are no longer in use and set GW_Volunteers__Inactive__c = true.
  3. Use Data Loader to perform bulk updates on Campaign.IsActive or GW_Volunteers__Volunteer_Job__c.GW_Volunteers__Inactive__c.
  4. Target a total qualifying job count below approximately 800 to allow headroom for future growth.

After cleanup, verify with Query 1 above that the count is below 999, then retest the Personal Site in an incognito browser window.

Long-term fix (Apex override): The VOL_CTRL_VolunteersReportHours class is open-source and available in the Volunteers-for-Salesforce GitHub repository. An unmanaged Apex extension can be created to override the listSOVolunteerJobs method and remove or increase the hardcoded limit, then the V4S site page can be pointed to the custom controller extension.

Knowledge 기사 번호

005321978

 
로드 중
Salesforce Help | Article