You need to sign in to do that
Don't have an account?
Joshua Anderson 17
Update via Process Builder on roll up.
So I have two rollup summaries (Total_Opportunities_Won__c && Active_Opportunities__c) that feed into the Account object from the opportunities object. I was trying to update a picklist (Customer_Type__c)
- Former Client = Total_Oppotunities_Won__c >= 1 && Active_Opportunities__c = 0
- Current Client = Total_Oppotunities_Won__c > 0 && Active_Opportunities__c = 1
- Prospect = Total_Oppotunities_Won__c = 0 && Active_Opportunities__c = 0
global class DailyContactProcessor implements Schedulable { global void execute(SchedulableContext ctx) { List<Contact> myList = [Select Id, Contact_Type__c from Contact where Account_Status__c = 'Former Client']; if(!myList.isEmpty()) { for(Contact l: myList) { l.Customer_Type__c = 'Former Customer'; } update myList; } } }In the Apex Class I created a formula field (Contact.Account_Status__c) which pulls from Account.Customer_Type__c. It is supposed to pull a list of all contacts that show 'Former Client' and then update
But I would recommend you to write a batch class instead of schedulable for serial processing of all the records.
Let me know if this helps you.