Ever wanted to mass-update a lot of records without changing modified by and date modified?
I used this approach to mass update all calculated fields on all records in Opportunities without changing any data and instead let Sugar do its calculation-magic.

Here's the trick:

1. Create a custom entry to your application by creating the file 'cusom_entries.php' in
2. Add the following content inside that file:
PHP Code:

['massupdateRecords'] = array(
'file' => '_scripts/massupdateRecords.php',
'auth' => true
3. create the folder "_scripts" inside your sugar root. And create the file "massupdateRecords.php" inside that folder.
You should now have this:
4. Add the following content inside massupdateRecords.php:
PHP Code:
// For debugging purposes.

 * Updates all opportunities (mass-update)
 * without changing date modified and modified by
global $db;

$sql="SELECT id FROM opportunities WHERE deleted='0'";

$row $db->fetchByAssoc($result))
$bean=new Opportunity;
// Add $bean->YOUR_AWESOME_FIELD; to whatever you'd like.


5. Do a quick "Rebuild and repair".
6. Goto your sugar url and append the following to the url: /index.php?entryPoint=massupdateRecords
So it should look like this:
7. Visit the link.

Congratz. You have now updated all your records.