<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brandon M. Westcrm &#187; Brandon M. West</title>
	<atom:link href="http://brandonmwest.com/tag/crm/feed" rel="self" type="application/rss+xml" />
	<link>http://brandonmwest.com</link>
	<description></description>
	<lastBuildDate>Sat, 18 Jun 2011 03:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Posting a Lead to SugarCRM from Drupal via Webform</title>
		<link>http://brandonmwest.com/dev/posting-a-lead-to-sugarcrm-from-drupal-via-webform</link>
		<comments>http://brandonmwest.com/dev/posting-a-lead-to-sugarcrm-from-drupal-via-webform#comments</comments>
		<pubDate>Sun, 07 Feb 2010 00:33:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[sugarcrm]]></category>
		<category><![CDATA[webform]]></category>

		<guid isPermaLink="false">http://brandonmwest.com/?p=32</guid>
		<description><![CDATA[I was helping a friend solve the issue of capturing a lead to Sugar 5.2 from a form in Drupal 6 and my searching was not turning up a clear answer. This article was a good start but was a bit out of date and missing a couple steps. On the issues page for the [...]]]></description>
			<content:encoded><![CDATA[<p>I was helping a friend solve the issue of capturing a lead to Sugar 5.2 from a form in Drupal 6 and my searching was not turning up a clear answer. <a href="http://www.computerminds.co.uk/how-capture-sugarcrm-leads-drupal">This article</a> was a good start but was a bit out of date and missing a couple steps. On the <a href="http://drupal.org/node/287183">issues page</a> for the SugarCRM Drupal module, I found a couple other useful hints. This guide should work for Drupal 6 and SugarCRM 5.1+.<br />
<span id="more-32"></span><br />
First, download these Drupal modules: <a href="http://drupal.org/project/sugarwebform">SugarCRM Webform Integration</a> and <a href="http://drupal.org/project/webform">Webform</a>. Extract these archives to your server and <a href="http://drupal.org/getting-started/install-contrib/modules">activate the modules in Drupal</a>.</p>
<p>Create a new file named leadCapture_override.php in the root folder of your SugarCRM install on your server. Open the file and paste the following code:</p>
<p>[cc lang="php"]<br />
# set up the array of usernames and hashed password<br />
$users = array(<br />
&#8216;Your_User_Name&#8217; => array(&#8216;name&#8217;=>&#8217;Your_User_Name&#8217;, &#8216;pass&#8217;=>&#8217;Your_User_Hash&#8217;,'userid&#8217;=>&#8217;Your_User_Id&#8217;)<br />
);</p>
<p># identify the web site user by id so we can assign the lead to them<br />
$assigned_user_id = $users[$_REQUEST['user']]['userid'];</p>
<p>if( !isset($_POST['assigned_user_id']) || !empty($_POST['assigned_user_id']) ){<br />
$_POST['assigned_user_id'] = $assigned_user_id;<br />
}</p>
<p># if we have an Opt-In field, we want to get rid of any Opt-Out field that we may have<br />
if ( !empty($_POST['email_opt_in']) ) {<br />
unset($_POST['email_opt_out']);<br />
}</p>
<p># convert opt out to an explicit binary boolean<br />
if ( isset($_POST['email_opt_out']) ) {<br />
$_POST['email_opt_out'] = 1;<br />
}<br />
[/cc]</p>
<p>Now you will need to enter your configuration&#8217;s user values In the $users array declaration (line 3 above). First enter the SugarCRM user name that will be assigned every lead coming from Drupal. Once you have the user name, replace Your_User_Name in the code above with it.</p>
<p>To get the userid and pass values, open your SugarCRM database with a database admin (such as phpMyAdmin) and run the following query: <strong>SELECT id, user_hash FROM users WHERE user_name=&#8217;Your_User_Name&#8217;</strong>. Replace Your_User_Id with the id value, and Your_User_Hash with the user_hash value.</p>
<p>The next step is creating your webform. For the purposes of this article I am assuming that all the fields you need to capture are already setup in Sugar. If not, maybe <a href="http://vimeo.com/5194233">this screencast</a> can help. If you need any help creating the webform, more information can be found in the <a href="http://drupal.org/handbook/modules/webform">Drupal documentation</a>.</p>
<p>Once you have your webform created, you will see a SugarCRM Settings area on the webform configuration screen.<br />
<a href="http://brandonmwest.com/wp-content/uploads/Drupal_SugarCRM_settings.png"><img class="aligncenter size-full wp-image-62" title="Drupal SugarCRM settings" src="http://brandonmwest.com/wp-content/uploads/Drupal_SugarCRM_settings.png" alt="" /></a></p>
<p>In the <em>Sugar Form is posted to</em> field, enter <strong>http://yoursugarinstanceURL/index.php?entryPoint=leadCapture</strong>. <em>Lead Source</em> can be whatever you&#8217;d like. The <em>SugarCRM User</em> field <strong>must </strong>match the value you entered for Your_User_Name in the leadCapture_override.php file created earlier.</p>
<p style="text-align: left;">Congratulations, your Drupal form should now capture leads in Sugar.</p>
<p style="text-align: right;">[ratings]</p>
]]></content:encoded>
			<wfw:commentRss>http://brandonmwest.com/dev/posting-a-lead-to-sugarcrm-from-drupal-via-webform/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: brandonmwest.com @ 2012-05-19 21:10:31 -->
