You need to sign in to do that
Don't have an account?
Run a mass edit to trigger Workflows
Hello,
Could anyone help me on how I get a mass edit on All Accounts which have a Status e.g. Customer. I have serveral Workflows which need to run daily for these Customers. However, the records need to be edited for the WF to trigger.
I'm not apex efficient and am not sure how to go about getting this done.
I have seen this:
in your developer console run the query. suppose your object is account.
List<Account> acc = [Select id from account limit 10000]; update acc
From this link: http://salesforce.stackexchange.com/questions/93434/trigger-a-mass-record-update-to-activate-workflow
But I am not sure where to start this? Can anyone guide me please.
Thank you
Jin
All Answers
You can run code directly from the Developer Console (menu under your name) and go to Debug > Open Execute Anonymous Window
Otherwise a more effective to automatize this could be to run a daily batch (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm)
Hi Emilien,
I did what you said and pasted the code in the window:
List<Account> acc = [Select id from account limit 10000]; update acc
I got an error:
Line: 2, Column: 0
expecting a semi-colon, found '<EOF>'
Ah Great thanks, lastly, how do i write so that i only want it to run on accounts that have the custom field marked as Customer
So, Account_Status__c is "Customer"
Hi Emilien,
I tried the same format for Contacts with this in the criteria
List<Contact> con = [Select id from contact where Main_Contact__c=TRUE]; update con;
but this is giving me an error of
Line: 6, Column: 1
System.LimitException: Apex CPU time limit exceeded