You need to sign in to do that
Don't have an account?
SOQL Limit
I have created this that updates a field that is associated with the whatID. It updates athe candidate status in the caniddate object based on a field that is inserted or updated in the event.event_type__C field.
Event.whatid = sfdc_candidate__C.ID
I am receiving a limit. How can I get this done with a list.
public class Event_WorkFlow_Manager
{
public static void UpdateCandidateStatus(Event[] EvRec) {
Profile PR = [Select Name from Profile where Id = '00e60000000updM'];
for (Event a:EvRec)
{
if (a.Subject != 'Sales Meeting' && a.type ==null)
{
Integer i = [select count() from SFDC_Candidate__c where Id = :a.WhatId];
if (PR.Name == 'DLC_Recruit_Test' && a.WhatId != null && i > 0) {
SFDC_Candidate__c cand = [
select Id, Contact__c, Name, (Select Id From Events where Id = :a.Id)
from SFDC_Candidate__c
where Id = :a.WhatId
];
// Offer Accepted workflow method to update Candidate Status
if (a.Event_Type__c == '1 - Qualified Profile') {
a.subject = 'Qualified Profile';
cand.Candidate_Status__c = 'Qualified';
cand.Candidate_Withdrew__c = a.Candidate_Withdrew__c;
cand.Start_Date_Current_Company__c = a.Start_Date__c;
cand.Candidate_Rejected__c = a.Candidate_Rejected__c ;
cand.Offer_Not_Extended__c= a.Offer_Not_Extended__c;
cand.Offer_Declined__c = a.Offer_Declined__c ;
cand.Fall_Off__c = a.Fall_Off__c;
try {
update cand;
}