-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSVextract.php
36 lines (27 loc) · 958 Bytes
/
CSVextract.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
ini_set("soap.wsdl_cache_enabled", "0");
error_reporting(0);
require_once ('soapclient/SforcePartnerClient.php');
require_once ('soapclient/SforceHeaderOptions.php');
require_once ('includes/func.php');
require_once ('includes/config.php');
//Processes the query to get account information from Salesforce
//~ log_it($soql);
//~ echo $soql;
echo "Capturing Records...... <br>";
$records = get_records($client, $soql);
if($records == 0){
echo "No Records Found <BR>";
exit();
}else{
echo "Sending File to FTP............<br>";
SendFileVia_FTP($ftp_dropoff_folder, $DropOff_file, $DropOff_file);
//~ echo "Emailing File to Admin..........<br>";
//~ email_file($DropOff_file);
echo "Removing CSV file from Local Directory.......<br>";
remove_csvdump($DropOff_file);
echo "Updating SFDC Records.......<BR>";
Update_CallResults($client, 'Pending fulfillment');
echo "Script Executed Succesfully!";
}
?>