You need to sign in to do that
Don't have an account?

Help with Compile Error: DML requires SObject or SObject list type: List<String>
Hello,
I am trying to add UPDATE functionality to a controller and am getting the error: DML requires SObject or SObject list type: List<String>
However my variable is set up like this: public List<String> campaigns {get;set;}
I am not sure how to achieve the proper syntax here, and was hoping that someone out there in developerland would be able to help me!
Here is my (broken) controller:
Thanks in advance!
John
I am trying to add UPDATE functionality to a controller and am getting the error: DML requires SObject or SObject list type: List<String>
However my variable is set up like this: public List<String> campaigns {get;set;}
I am not sure how to achieve the proper syntax here, and was hoping that someone out there in developerland would be able to help me!
Here is my (broken) controller:
public with sharing class QualOpController { public List <Opportunity> listOfOpty {get;set;} public List<String> campaigns {get;set;} public PageReference saveOp(){ UPDATE campaigns; return null; } public String getName(){ return 'QualOpController'; } public void load() { campaigns= new List<String>(); listOfOpty = [Select id, name, CreatedDate, StageName, Vert_Med__c, Company_Name__c, Next_Step__c, Vertical__c, Weeks_Live__c, Days_Since_Last_Modified__c, Contract_SENT__c, NextStep, LeadSource, Probability, Spend_Last_Week__c, Spend_Last_30_Days__c, Owner_Name__c, Revenue_All_Time__c from Opportunity WHERE Pipeline_Oppty__c = TRUE ]; Set<String> campaignSet = new Set<String>(); for (Opportunity j : listOfOpty) campaignSet.add(j.Vert_Med__c); for (String campaign : campaignSet) { campaigns.add(campaign); } campaigns.sort(); } }
Thanks in advance!
John
Lines 22-30 dynamically group the querry results by a picklist value on the Opportunity Record. I used this article as a template: http://blog.jeffdouglas.com/2011/03/02/dynamically-group-display-query-results/
Here is how it is output in VF:
Could there be a problem with my VF markup?