ANSWER: defrag the database using esentutl.exe
Here's what I did
C:\Windows\system32>esentutl /d C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
Extensible Storage Engine Utilities for Microsoft(R) Windows(R)
Version 6.0
Copyright (C) Microsoft Corporation. All Rights Reserved.
Initiating DEFRAGMENTATION mode...
Database: C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
Temp. Database: TEMPDFRG4872.EDB
Defragmentation Status (% complete)
0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----|
...................................................
Moving 'TEMPDFRG4872.EDB' to 'C:\Windows\SoftwareDistribution\DataStore\DataStore.edb'..
Note:
It is recommended that you immediately perform a full backup
of this database. If you restore a backup made before the
defragmentation, the database will be rolled back to the state
it was in at the time of that backup.
Operation completed successfully in 27.875 seconds.
Now i have an extra 400MB free - makes the difference on vista!
Retire early - let the internet work for you - create automated sales systems and more.
Monday, 23 February 2015
Thursday, 15 January 2015
sugar crm rest api example
REST api Example
source: http://urdhva-tech.blogspot.co.uk/2013/02/rest-api-example.html
Create a new record in Lead module
As we have session id, we are logged-in!, we will use that session id to create a new record.
Here we used set_entry method for that we need three parameters
1) session : pass current session id
2) module : module name to create a record
3) name_value_list : name value list combination
Let's see that in below code snippets
Read detail of top 5 leads having work phone, as an example.
Update a lead status "New" to "Assigned" for lead which we have just created. We can use set_entry method with specified record id to update a value.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId), //Record id to update
array('name' => 'status', 'value' => 'Assigned'),
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Updated, Updated id ".$recordId;
Delete a record via web-service. It is as simple as we update record with id. Here we need to provide id and deleted equal 1.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId),
array('name' => 'deleted', 'value' => '1') //Deleted flag
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Deleted!, Deleted record id is ".$recordId;
At times developers find it so difficult to find simple and running example of REST API to perform CRUD operations on SugarCRM.. There are plenty of tutorials, blogs, developer guides explaining same thing. Still for an ease for ourselves and to the hunters of same, writing the same thing all over again.
REST Example
This blog post explains how to login to SugarCRM instance with admin user.
<?php
// specify the REST web service to interact with
$url = '<SITE_URL_OF_SUGAR>/service/v2/rest.php';
// Open a curl session for making the call
$curl = curl_init($url);
// Tell curl to use HTTP POST
curl_setopt($curl, CURLOPT_POST, true);
// Tell curl not to return headers, but do return the response
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
// Set the POST arguments to pass to the Sugar server
$parameters = array(
'user_auth' => array(
'user_name' => 'admin',
'password' => md5('<ADMIN_PASSWORD>'),
),
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'login',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json,
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
if ( !is_object($result) ) {
die("Error handling result.\n");
}
if ( !isset($result->id) ) {
die("Error: {$result->name} - {$result->description}\n.");
}
// Echo out the session id
echo $result->id."<br />";
$session = $result->id;
$session = $result->id;
Create a new record in Lead module
As we have session id, we are logged-in!, we will use that session id to create a new record.
Here we used set_entry method for that we need three parameters
1) session : pass current session id
2) module : module name to create a record
3) name_value_list : name value list combination
Let's see that in below code snippets
$parameters = array(
'session' => $session, //Session ID
'module' => 'Leads', //Module name
'name_value_list' => array (
array('name' => 'first_name', 'value' => 'David'),
array('name' => 'last_name', 'value' => 'Boris'),
array('name' => 'status', 'value' => 'New'),
array('name' => 'lead_source', 'value' => 'Web Site')
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "New Record Created with ID ".$recordId;
'session' => $session, //Session ID
'module' => 'Leads', //Module name
'name_value_list' => array (
array('name' => 'first_name', 'value' => 'David'),
array('name' => 'last_name', 'value' => 'Boris'),
array('name' => 'status', 'value' => 'New'),
array('name' => 'lead_source', 'value' => 'Web Site')
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "New Record Created with ID ".$recordId;
Read detail of top 5 leads having work phone, as an example.
// Let us fetch detail of a Lead
$fields_array = array('first_name','last_name','phone_work');
$parameters = array(
'session' => $session, //Session ID
'module_name' => 'Leads', //Module name
'query' => " leads.phone_work IS NOT NULL ", //Where condition without "where" keyword
'order_by' => " leads.last_name ", //$order_by
'offset' => 0, //offset
'select_fields' => $fields_array, //select_fields
'link_name_to_fields_array' => array(array()),//optional
'max_results' => 5, //max results
'deleted' => 'false', //deleted
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'get_entry_list',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json,
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
print "<pre>";
print_r($result);
die;
$fields_array = array('first_name','last_name','phone_work');
$parameters = array(
'session' => $session, //Session ID
'module_name' => 'Leads', //Module name
'query' => " leads.phone_work IS NOT NULL ", //Where condition without "where" keyword
'order_by' => " leads.last_name ", //$order_by
'offset' => 0, //offset
'select_fields' => $fields_array, //select_fields
'link_name_to_fields_array' => array(array()),//optional
'max_results' => 5, //max results
'deleted' => 'false', //deleted
);
$json = json_encode($parameters);
$postArgs = array(
'method' => 'get_entry_list',
'input_type' => 'JSON',
'response_type' => 'JSON',
'rest_data' => $json,
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response);
print "<pre>";
print_r($result);
die;
Update a lead status "New" to "Assigned" for lead which we have just created. We can use set_entry method with specified record id to update a value.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId), //Record id to update
array('name' => 'status', 'value' => 'Assigned'),
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Updated, Updated id ".$recordId;
Delete a record via web-service. It is as simple as we update record with id. Here we need to provide id and deleted equal 1.
$recordId = "<Your 36 character record id>";
$parameters = array(
'session' => $session,
'module' => 'Leads',
'name_value_list' => array(
array('name' => 'id', 'value' => $recordId),
array('name' => 'deleted', 'value' => '1') //Deleted flag
),
);
$json = json_encode($parameters);
$postArgs = 'method=set_entry&input_type=JSON&response_type=JSON&rest_data=' . $json;
curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
// Make the REST call, returning the result
$response = curl_exec($curl);
// Convert the result from JSON format to a PHP array
$result = json_decode($response,true);
// Get the newly created record id
$recordId = $result['id'];
print "Record Deleted!, Deleted record id is ".$recordId;
Friday, 12 December 2014
how to show errors in php - answers in an instant
error_reporting(E_ALL);
ini_set('display_errors', 1);
source: http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display
Saturday, 7 December 2013
3 reasons people may be put off calling you about your business opportunity
Is an 08 number putting off potential customers daily? |
Do you want more people calling you about your business opportunity?
We've discovered that having a UK local landline number can improve your chances of getting people to call you about your business opportunity. Here's why..
1. Most people have minutes included to land lines in their home or mobile package
2. Freephone (0800 or 0808) numbers are not free for mobiles
3. More people have mobiles than land lines
Get an 0113 Leeds number now – free trial for 1 week followed by £4.99 a month.
More effective than a 0800 and now includes free voicemail service which emails you the voicemail message.
Your exclusive offer
code is
http://goo.gl/RHPWWq
http://goo.gl/RHPWWq
Order your free trial
now.
Other UK codes are available. Please contact mark@hopgood.eu for more details
Never miss a call - get a mobile friendly dedicated number with voicemail for £4.99 a month
Here's a way to get a dedicated local number for your business with voicemail for just £4.99 a month.
First week free - you can try it for a month with no further charges if you cancel in week 1.
As a comparison, BT's standard line rental is £15.45/mth (£15.99/mth from Jan 2014)
Choose from the following UK number prefixes.
First week free - you can try it for a month with no further charges if you cancel in week 1.
As a comparison, BT's standard line rental is £15.45/mth (£15.99/mth from Jan 2014)
Choose from the following UK number prefixes.
0113 Leeds
0114 Sheffield
0115 Nottingham
0116 Leicester
0117 Bristol
0118 ReadingWednesday, 17 October 2012
Register for the MonaVie weekly webcast
MonaVie is a range of healthy natural products, MonaVie is a business and an opportunity.
With the MonaVie opportunity more people make more money, more quickly!
Join us in our weekly webcast, watch the video then enter your details for reminders.
MonaVie Executive Elite Distributors with Executive Distributors Mark and Sue Hopgood
Register for the MonaVie weekly webcast which includes a 5 star opportunity presentation and motivational videos.
Register for the MonaVie weekly webcastClaim your place on the weekly MonaVie Webcast. We will also send you details of our next meeting and regular motivational messages, free of charge.
With the MonaVie opportunity more people make more money, more quickly!
Join us in our weekly webcast, watch the video then enter your details for reminders.
Register for the MonaVie weekly webcast which includes a 5 star opportunity presentation and motivational videos.
Subscribe to:
Posts (Atom)