You need to sign in to do that
Don't have an account?
pratyusha raavipati
i want apex code for mass update button for task
hi,
actually my requirement was i have so many tasks to complete but i did not completed on this day so have to postphone then to someother day means i want change the date at a time for suppose of 50 tasks
please help me
Thanks & Regards
Pratyusha K
actually my requirement was i have so many tasks to complete but i did not completed on this day so have to postphone then to someother day means i want change the date at a time for suppose of 50 tasks
please help me
Thanks & Regards
Pratyusha K
This is a very, very basic example you can work off of. Here's what's going on:
You are creating a method to be called from the Visualforce page called "updateMyAccounts". First in the method, you are creating a list of Object__c records by running a query. The query I wrote simply grabs only the info you need for this example: the id of the record and the Custom_Date_Field__c for each record. I added a filter to only select records "WHERE CreatedDate = TODAY" just as an example of a filter you can add to narrow which records you want to mass update. Keep in mind pulling back 10,000+ records will error out when updating. Next, you enter a for loop to iterate through the list and assign today's date to the Custom_Date_Field__c for each record. Then you will update the entire list to save the changes to the date field.
In your Visualforce page you will create a button that can be pressed and when it is, the method above will run and all the records will be updated.
Controller Page: Visual Force Page: Please mark this as solved if the information helps so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Best Regards,
Nagendra.