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
Code:
*sugar_root*/custom/Extension/application/Ext/EntryPointRegistry/
2. Add the following content inside that file:
PHP Code:
<?php

$entry_point_registry
['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:
Code:
*sugar_root*/_scripts/massupdateRecords.php
4. Add the following content inside massupdateRecords.php:
PHP Code:
<?php
// For debugging purposes.
error_reporting(-1);
ini_set("display_errors""On");

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

$sql="SELECT id FROM opportunities WHERE deleted='0'";
$result=$db->query($sql);

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

    
$bean->update_date_modified=false;
    
$bean->update_modified_by=false;
    
$bean->save();
}

?>
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:
Code:
http://sugarcrm.localhost.com/index.php?entryPoint=massupdateRecords
7. Visit the link.

Congratz. You have now updated all your records.