Edit file File name : sync_contacts.php Content :<?PHP //ob_start(); //ini_set('open_basedir','0'); //ini_set('error_reporting', "E_ALL"); ini_set('display_errors', 0); //echo ini_get('display_errors'); //ini_set('max_execution_time', '36000'); define('sugarEntry', 'index.php'); require_once('include/MVC/SugarApplication.php'); require_once('data/SugarBean.php'); require_once('config.php'); if (file_exists('include/database/PearDatabase.php')) require_once('include/database/PearDatabase.php'); require_once('include/nusoap/nusoap.php'); include_once ("googlecontacts/clsParseXMLGoogle.php"); include_once ("include/TimeDate.php"); include_once ("googlecontacts/GoogleContacts.php"); include_once ("googlecontacts/GoogleClass.php"); require_once("modules/Users/User.php"); require_once("modules/Tasks/Task.php"); require_once("modules/Administration/Administration.php"); require_once("google_contacts_conf.php"); global $server, $sugar_config, $system_config,$current_user; $arr_modules[]="Tasks"; $startTime = microtime(); require_once('include/entryPoint.php'); require_once('include/MVC/SugarApplication.php'); $app = new SugarApplication(); $app->startSession(); global $db; if (isset($_REQUEST['SyncMyContactstoGoogle'])){ $app->loadUser(); $_REQUEST['sel_user']=1; } if (!isset($_REQUEST['ou'])){ $only_user=false; }else{ $only_user=true; } if (!file_exists("google_contacts_tc.php")){ $sq="CREATE TABLE `google_contacts_rel` ( `id` VARCHAR(36), `obj_id` VARCHAR(36), `obj_type` VARCHAR(36), `user_id` VARCHAR(36), `old_id_c` VARCHAR(255), `old_link_edit_c` VARCHAR(255), `last_google_contacts_upload_c` DATETIME, `deleted` INTEGER UNSIGNED DEFAULT 0, `deleted_sent` INTEGER UNSIGNED DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE = MyISAM;"; $db->query($sq); //dmc sugarondemand. //$f = fopen("google_contacts_tc.php","w+"); //fclose($f); } //global $db; //$sq="delete from google_contacts_rel "; //$db->query($sq); // exit; $gc = new GooCts(); $gc->get_users_array($only_user); $gc->get_tokens(); $gc->get_contacts(); $gc->send_contacts(); $gc->get_deleted_contacts(); $gc->delete_contacts(); echo "<br>Sync finished"; ?>Save