OK well I moved my SuiteCRM PHPMyAdmin over to my Joomla anyways. But still can't get it to work and I've been this thread over and over for the last 3 weekends now. Thought I followed instructions to a T. Totally stuck, any help is appreciated.
I must be getting the variable wrong, when I fill out the form it updates on BreezingForms but not CRM. Here's the exact steps and code I did:
Step-1:
Go to Form Pieces>Before Form>custom and add the following code: (In Joomla)
//Capturing Breezing Form record ID
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Libraries
$db = JFactory::getDBO(); //Include Database Object
//Create database query
$query = 'SELECT MAX(id) FROM joomla_facileforms_records';
//Query the database
$db->setQuery($query);
$result = intval($db->loadResult()) + 1;
//Assign value to form element
ff_setValue('recordID', $result); // You need to create a hidden input in form with name 'recordID'. (Mandatory)
//Capturing Breezing Form record ID ends here
I changed the part highlighted in red $query = 'SELECT MAX(id) FROM
joomla_facileforms_records';
Step-2:
Go to your form itself and create a 'hidden input' field, which need to have the name 'recordID' (mandatory).
Did exactly that and used the same recordID
Go to Submit Pieces>End Submit>custom and add the following code to your original code meant for SuiteCRM/SugarCRM
//The following section is meant for passing the variables to SugarCRM or SuiteCRM's table Leads and needs to be added to 'Submit pieces' section of the your Breezing Form
$this->execPieceByName('ff_InitLib');
echo '
<form id="WebToLeadForm" action="http://viralinnature.com/crm/index.php?entryPoint=WebToPersonCapture" method="POST" name="WebToLeadForm">
<input name="campaign_id" id="campaign_id" type="hidden" value="c099d5be-6a65-2b28-8dde-599aa9c6fdc1" />
<input name="redirect_url" id="redirect_url" type="hidden" value="http://viralinnature.com/thank-you" />
<input name="assigned_user_id" id="assigned_user_id" type="hidden" value="1" />
<input name="moduleDir" id="moduleDir" type="hidden" value="Leads" />
<input type="hidden" name="name" value="'.htmlentities( ff_getSubmit('last_name') ).'"/>
<input type="hidden" name="company" value="'.htmlentities( ff_getSubmit('company_c') ).'"/>
<input type="hidden" name="website" value="'.htmlentities( ff_getSubmit('website') ).'"/>
<input type="hidden" name="copy_contact" value="'.htmlentities( ff_getSubmit('recordID') ).'"/>
<input type="hidden" name="city" value="'.htmlentities( ff_getSubmit('primary_address_city') ).'"/>
<input type="hidden" name="email" value="'.htmlentities( ff_getSubmit ('email1') ).'"/>
<input type="hidden" name="phone" value="'.htmlentities( ff_getSubmit ('phone_mobile') ).'"/>
<input type="hidden" name="message" value="'.htmlentities( ff_getSubmit ('message_c') ).'"/>
<!-- and so on ... -->
</form>
<script>
document.getElementById("bool_id").submit();
</script>
';
//Section Ends Here
I copied and pasted this code directly from the form my CRM generated
<form id="WebToLeadForm"..........to..........type="hidden" value="Leads" />
The blue is what I took from breezingforms, orange is from CRM.
<input type="hidden" name="
company" value="'.htmlentities( ff_getSubmit('
company_c') ).'"/>
Changed this
document.getElementById("myresubmit").submit();
to this
document.getElementById("bool_id").submit();