Integration of Breezing Form & SugarCRM/ SuiteCRM

  • Rajneesh
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 53
  • Thank you received: 0

Rajneesh replied the topic: Has anyone succeeded in intergrat'g BF & SugarCRM?

Don't focus too much on capturing the Record ID when a new record is created in Breezing Forms table(s). I needed this, that's why whole code shared on page-3 of this post is focused on that. You may not need that.

However, original solution was achieved on page-1 and early part of page-2. Kindly look deeper there primarily.

With thanks,
RK
#206876
  • Posts: 6
  • Thank you received: 0

ViralInNature replied the topic: Has anyone succeeded in intergrat'g BF & SugarCRM?

Damn, made the change, still didn't work. Then went through every post from page 1 to 3, still no luck.

The parts in red is what I've changed
Form pieces:

//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 apr15_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


Submit pieces - End Submit

//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="/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=" 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="email" value="'.htmlentities( ff_getSubmit('email1') ).'"/>
<input type="hidden" name="phone" value="'.htmlentities( ff_getSubmit ('phone_mobile') ).'"/>
<input type="hidden" name="city" value="'.htmlentities( ff_getSubmit ('primary_address_city') ).'"/>
<input type="hidden" name="message" value="'.htmlentities( ff_getSubmit ('message_c') ).'"/>
<!-- and so on ... -->
</form>

<script>
document.getElementById("WebToLeadForm").submit();
</script>
';

//Section Ends Here



This is what my form is being generated as on the CRM
<html lang='en_us'><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><style type="text/css"><!--
form#WebToLeadForm, form#WebToLeadForm * {margin: 0; padding: 0; border: none; color: #333; font-size: 12px; line-height: 1.6em; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;}
form#WebToLeadForm {float: left; border: 1px solid #ccc; margin: 10px;}
form#WebToLeadForm h1 {font-size: 32px; font-weight: bold; background-color: rgb(60, 141, 188); color: rgb(247, 247, 247); padding: 10px 20px;}
form#WebToLeadForm h2 {font-size: 24px; font-weight: bold; background-color: rgb(60, 141, 188); color: rgb(247, 247, 247); padding: 10px 20px;}
form#WebToLeadForm h3 {font-size: 12px; font-weight: bold; padding: 10px 20px;}
form#WebToLeadForm h4 {font-size: 10px; font-weight: bold; padding: 10px 20px;}
form#WebToLeadForm h5 {font-size: 8px; font-weight: bold; padding: 10px 20px;}
form#WebToLeadForm h6 {font-size: 6px; font-weight: bold; padding: 10px 20px;}
form#WebToLeadForm p {padding: 10px 20px;}
form#WebToLeadForm input,
form#WebToLeadForm select,
form#WebToLeadForm textarea {border: 1px solid #ccc; display: block; float: left; min-width: 170px; padding: 5px;}
form#WebToLeadForm select {background-color: white;}
form#WebToLeadForm input[type="button"],
form#WebToLeadForm input[type="submit"] {display: inline; float: none; padding: 5px 10px; width: auto; min-width: auto;}
form#WebToLeadForm input[type="checkbox"],
form#WebToLeadForm input[type="radio"] {width: 18px; min-width: auto;}
form#WebToLeadForm div.col {display: block; float: left; width: 330px; padding: 10px 20px;}
form#WebToLeadForm div.clear {display: block; float: none; clear: both; height: 0px; overflow: hidden;}
form#WebToLeadForm div.center {text-align: center;}
form#WebToLeadForm div.buttons {padding: 10px 0; border-top: 1px solid #ccc; background-color: #f7f7f7}
form#WebToLeadForm label {display: block; float: left; width: 160px; font-weight: bold;}
form#WebToLeadForm span.required {color: #FF0000;}
--></style>
<!-- TODO ???
<script type="text/javascript" src='http://viralinnature.com/crm/cache/include/javascript/sugar_grp1.js?v=GqzRhFmbfKGdZmovVM5_KQ'></script>
--><form id="WebToLeadForm" action="http://viralinnature.com/crm/index.php?entryPoint=WebToPersonCapture" method="POST" name="WebToLeadForm">
<h2>Web form to create Leads</h2>
<p>Submitting this form will create Leads</p>
<div class="row">
<div class="col"><label>Name: <span class="required">*</span></label><input name="last_name" id="last_name" type="text" required="" /></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row">
<div class="col"><label>Mobile: </label><input name="phone_mobile" id="phone_mobile" type="text" /></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row">
<div class="col"><label>Email Address: </label><input name="email1" id="email1" type="email" /></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row">
<div class="col"><label>Primary Address City: </label><input name="primary_address_city" id="primary_address_city" type="text" /></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row">
<div class="col"><label>Company: </label><input name="company_c" id="company_c" type="text" /></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row">
<div class="col"><label>Message: </label><span class="sugarslot"><textarea name="message_c" id="message_c"   /> </textarea></span></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row">
<div class="col"><label>Website: </label><input name="website" id="website" type="text" /></div>
<div class="col">� </div>
<div class="clear">� </div>
</div>
<div class="row center buttons"><input class="button" name="Submit" type="submit" value="Submit" onclick="submit_form();" />
<div class="clear">� </div>
</div>
<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" /></form>
<p>
<script type="text/javascript">// <![CDATA[
    function submit_form() {
        if (typeof(validateCaptchaAndSubmit) != 'undefined') {
            validateCaptchaAndSubmit();
        } else {
            check_webtolead_fields();
            //document.WebToLeadForm.submit();
        }
    }

    function check_webtolead_fields() {
        if (document.getElementById('bool_id') != null) {
            var reqs = document.getElementById('bool_id').value;
            bools = reqs.substring(0, reqs.lastIndexOf(';'));
            var bool_fields = new Array();
            var bool_fields = bools.split(';');
            nbr_fields = bool_fields.length;
            for (var i = 0; i < nbr_fields; i++) {
                if (document.getElementById(bool_fields[i]).value == 'on') {
                    document.getElementById(bool_fields[i]).value = 1;
                } else {
                    document.getElementById(bool_fields[i]).value = 0;
                }
            }
        }
    }
// ]]></script>
</p></body></html>

I really appreciate your help. You have no idea how many hours I have spent on this.
#206877
  • Posts: 6
  • Thank you received: 0

ViralInNature replied the topic: Has anyone succeeded in intergrat'g BF & SugarCRM?

Should this link when I click on it be saying: Not a valid module directory

viralinnature.com/crm/index.php?entryPoint=WebToPersonCapture
#206878
  • Posts: 6
  • Thank you received: 0

ViralInNature replied the topic: Has anyone succeeded in intergrat'g BF & SugarCRM?

I feel like I'm really close. I added this code
exit;
at the end of the Submit Pieces code and BF worked perfect and CRM created an entry, but it didn't store any data in it.
#206882
  • Posts: 6
  • Thank you received: 0

ViralInNature replied the topic: Has anyone succeeded in intergrat'g BF & SugarCRM?

OK got it. To fix I added this at the end:
exit;
And I also had these reversed
<input type="hidden" name="email1" value="'.htmlentities( ff_getSubmit('email') ).'"/>
#207338
  • Posts: 1
  • Thank you received: 0

cinterpro replied the topic: Has anyone succeeded in intergrat'g BF & SugarCRM?

Hello there Rajneesh.
I see how you are implementing a form to do an insert into Suitecrm.
I have some quistions about this. Can you reach out to me please?
My email is: paco@almena.biz or feel free to skype me at: paco_getafe
Hoping to hear from you again.
Regards,
Paco
#238088
Moderators: ForumSupporttomeperica
Time to create page: 0.070 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here