Open main menu

Changes

1,371 bytes added ,  10:41, 7 February 2017
m
== Intro ==[http://www.sugarcrm.com SugarCRM] is the world's leading Customer Relationship Management (CRM) software available with complete freedom under the GPL license. Because CRM software captures the varied relationships between a company and it's sources of revenue, most businesses really stand to benefit from the intelligence provided by a CRM system. All companies already have 'ad-hoc' methods to track leads, contacts, customer accounts and the company interactions with these (e.g. spreadsheets, lists and email records); or they even have organized CRM solutions in place. Either way, once you decide to adopt an open and standards-based solution like SugarCRM, your first order of business will be to load it with your existing data. SugarCRM has importing (and exporting) utilities that make it easy to do this, so that will not be the focus of this article. Instead, we'll focus on programmatic interaction with the system. Once the CRM system is deployed, a company will also typically want to create one or more pipelines which act as conduits to capture new account, and contact information. This article will show how easy it can be to establish a web service, using [[wp:SOAP]] to add contacts and accounts to your SugarCRM installation. As an example, let's suppose that a conference organizer wants to offer a sign-up sheet on their existing website. The existing website could be a [http://drupal.org drupal] content management system (CMS) which not only manages the conference, but also adds company and individual contact details to the SugarCRM system via the web service. The details on creating the form for the capture are beyond the scope of this article but the capture routines could easily handle a form input (HTTP POST) just as easily as we read input from a file . We'll focus on the plumbing of the interaction with the SOAP server.{{Not free|CiviCRM}}
== Goal ==Import records into [http://en.wikipedia.org/wiki/Sugarcrm SugarCRM] is the world's leading Customer Relationship Management (CRM) software available with complete freedom under the GPL license. For companies that want more than freedom, SugarCRM Inc, fully backs the product with expert support, service, training and customization. SugarCRM without using existing import utilitiesoffers several deployment options, including on-demand, on-premise and appliance-based solutions to suit customers' security, integration and configuration needs. Because CRM software captures the varied relationships between a company and it's sources of revenue, but rather most businesses really stand to benefit from the intelligence provided by writing a tool CRM system. All companies already have 'ad-hoc' methods to track leads, contacts, customer accounts and the company interactions with these (e.g. spreadsheets, lists and email records). They may even have organized CRM solutions in [[wp:PHP]] place. Either way, once you decide to adopt an open and standards-based solution like SugarCRM, your first order of business will be to load it with your existing data. SugarCRM has importing (and exporting) utilities that make it easy to do this, so these wizards will not be the workfocus of this article. Records should go into Accounts and ContactsInstead, while creating a relationship between we'll focus on programmatic interaction with the twosystem. <!--{{Infobox Company|company_name=SugarCRM|company_type=Private|foundation=[[California]] 2004|location=[[Cupertino, California]]|industry=CRM Software|products= Sugar Community Edition, Sugar Professional, Sugar Enterprise|num_employees=150+|parent=|subsid=|homepage=[http://www.sugarcrm.com/ www.sugarcrm.com]}} -->{{Infobox|name = SugarCRM|bodystyle = |title = Company Info|titlestyle = |above = |abovestyle = |image = |imagestyle = |caption = |captionstyle = |headerstyle = |labelstyle = |datastyle =
|header1 =|label1 = Company Name|data1 = Download and Install SugarCRM |header2 = |label2 = Company Type|data2 = private|header3 = |label3 = Founded|data3 =California 2004|header4 =SugarCRM provides easy stack installers which make trying the system as close to a one-click operation as possible. |label4 = Industry|data4 = CRM Software|header5 However= |label5 = Products|data5 = Sugar Community Edition, in the many scenarios the developer or system administrator will want to install into an existing infrastructure so we'll assume that approach.Sugar Professional, Sugar Enterprise|header6 = |label6 = Employees|data6 = 150+|header7 = |label7 = Website# Visit the |data7 = [http://www.sugarcrm.com/ www.sugarcrm.com SugarCRM homepage], and click the top navbar link to "Sugar Open Source"# Skip |header8 = |label8 = |data8 = |header9 = |label9 = |data9 = |header10 = |label10 = |data10 = }}== Introduction ==Typically a company will deploy the "Wizard" CRM system and go right will also create one or more pipelines which act as conduits to the "Download Page" because you know what you're doing capture new account, and also have contact information. This article will show how to establish a pre-existing setup of Linuxweb service, Apache MySQL and PHP# Download SugarCE-5.0.0e.zip (production release) or the later available production release (getting only the application).# Visit the recommended "Installation" instructions page at using [http://wwwen.sugarforgewikipedia.org/contentwiki/SOAP SOAP] to add contacts and accounts to your [[Installing SugarCRM|SugarCRM installation/# Install SugarCRM according to the instructions]]. Note: I immediately ran into trouble because the instructions did say to chmod 766 all files As an example scenario, let's suppose that needed a conference organizer wants to offer a sign-up sheet on their existing website. The existing website could be writable by the web_usera [http://drupal. This command renders the directories non-executable which manifests in include errors because the web user org Drupal] content management system (www-dataCMS) can which not see into those directories (only manages the conference, but also adds company and individual contact details to find includes)the SugarCRM system via the web service. The following snippet is a fix:<source lang="bash"># find directories in details on creating the form for the capture are beyond the ./crm path and change scope of this article but the mode on them so that all users can execute capture routines could easily handle a form input (see intoHTTP POST) just as easily as we read input from a file . Again our focus for today will be on the directory find plumbing of the interaction with the SOAP server./crm/ -type d |xargs chmod a+x </source>
There is one more 'gotcha' that I ran == Goal ==Import records into with the installation. The application wants to create SugarCRM without using existing import wizards but rather by writing a .htaccess file (which doesn't exist tool in the distribution and would not necessarily be writable to the web user[http://en.) As a failsafe, the wikipedia.htaccess content is printed org/wiki/PHP PHP] to do the screen in the installerwork. However it doesn't properly display (lacking newline characters) so the content is not suitable for copy Records should go into Accounts and paste into the file. I resorted to the source which generates the .htaccess contentContacts, and used that. An alternative is to simply touch and chmod 777 while creating a .htaccess file '''prior''' to running relationship between the installer; and then chmod'ing it go=r after installtwo.
== Requirements ==
My self-imposed requirement was Assume that we start with a spreadsheet that has column headings matching the 17 fields shown below. Assume too that we want to capture all of the data in my the sample assuming the . (The owner of the data collected it for a reason and that they wouldn't be too happy with a loss of data in a migration to a new application. !) I did not define new fieldsin the database, but I did 'draw' a map of correlate my data source and how it corresponds to the data definition of the Accounts and Contacts tables. Because I had parsed the data source (spreadsheet or CSV file) for column headings, I simply exported that variable and then used it as a comment right in my code workup as I went. What I mean is that I created a PHP (array) variable of the 17 field names, and then used the [http://php.net/var_export|var_export]() function to print it and copy/paste into a comment block so that I could mark up a plan for mapping those fields into fields in SugarCRM.
<source lang="php">
The form can be found in the "examples" directory in the source. Note: the example did not work as an application entry point (because even though it defined ('sugarEntry', true); there was also an IF that pre-empted that definition -- because requests inside the SugarCRM install directory will automatically bootstrap the SugarCRM system). To work around this, either put the example form outside the application directory or define sugarEntry as true ''without'' the 'if' conditional. Using the lead capture form is illustrated at http://www.sugarcrm.com/wiki/index.php?title=Creating_a_lead_capture_form_for_your_website
If your needs are more complex than the simple example, you can learn more by looking at the modules dealing with Import (dataMaps), the database abstraction layer (SugarBeans and VarDefs) or the database directly to get a clearer picture of everything going on in the SugarCRM system.
=== Use the Source Luke ===
/**
// alternately, if you have both ids, you can set the relationship for these two records using use set_relationship
$set_relationship_params = array(
'session' => $session_id,
</source>
== Conclusion ==
In this article we've shown how the SugarCRM system is enterprise-ready in that it has a fully built SOAP service that can be used to integrate the system with one or more 'front-end' websites or applications for data capture. With important information easily added to the system, it allows the company to focus resources on managing the most valuable assets. Due to SugarCRM's open source nature and standards support, it's easy to extend and integrate the system with other existing or new infrastructure components. In future articles, we'll take a look at still more interesting integrations with SugarCRM such as collaboration, document management and knowledge management.
 <table class="toc"><tr><td>-- Greg Rundlett<br />Greg Rundlett is an open source technologist. He currently manages the Technology Services team at [http://www.oasis-open.org OASIS]. <br />''This website is not affiliated nor endorsed by any third-party .''</td></tr></table>  = = Postscript: Some Improvements for SugarCRM == As with any software, there is always room for improvement. Here are some minor issues that I noted in the course of writing this article.
# "Import Step 2: Upload Export File" is a confusing title on the second step of the "Import Contacts" wizard. How can one use the words 'import', 'upload', 'export' all at once? It could read "Import Step 2: Select Data File to load"
# Typographical bug: I saw that the term "custom_delimeted" in the language files. It doesn't actually cause any errors, but b/c the term is used elsewhere (spelled correctly), this typo could potentially lead to a real bug down the line.
## ./modules/Import/ImportStep1.html
## ./modules/Import/ImportStep2.php
# The source is formatted poorly, or practically not at all in some cases, due to various editors using different space and tab settings, and line endings. PHPBeautifier [http://pear.php.net/package/PHP_Beautifier PHP Beautifier] used in a commit hook would solve this in the repoversion control system. Coding standards and configuration files like vim modelines would solve this on the developer desktop.
Being open source, I can pass this information on to the developers (or even get involved myselfby posting articles like this to [http://www.sugarcrm.com/wiki/index.php?title=Main_Page the wiki]) and will likely see a positive response to these suggested fixes. Note too - SugarCRM fosters an extended community of value-add partners through it's [http://www.sugarforge.org/ forge site].
== Further Resources ==
* http://dietrich.ganx4.com/nusoap/
* http://www.beanizer.org/site/index.php/en/Articles/Sugar-CRM-integration-with-custom-PHP-applications-I.html
 
[[Category:CRM]]
[[Category:Code]]
[[Category:Software]]
4,558

edits