TOPIC:

Has anyone succeeded in intergrat'g BF & SugarCRM? 2 years 11 months ago #206876

  • Topic Author
  • Rajneesh
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
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

Please Log in or Create an account to join the conversation.

Last edit: Post by Rajneesh.

Has anyone succeeded in intergrat'g BF & SugarCRM? 2 years 11 months ago #206877

  • ViralInNature
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
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.

Please Log in or Create an account to join the conversation.

Last edit: Post by ViralInNature.

Has anyone succeeded in intergrat'g BF & SugarCRM? 2 years 11 months ago #206878

  • ViralInNature
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
Should this link when I click on it be saying: Not a valid module directory

viralinnature.com/crm/index.php?entryPoint=WebToPersonCapture

Please Log in or Create an account to join the conversation.

Has anyone succeeded in intergrat'g BF & SugarCRM? 2 years 11 months ago #206882

  • ViralInNature
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
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.

Please Log in or Create an account to join the conversation.

Has anyone succeeded in intergrat'g BF & SugarCRM? 2 years 10 months ago #207338

  • ViralInNature
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
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') ).'"/>

Please Log in or Create an account to join the conversation.

Has anyone succeeded in intergrat'g BF & SugarCRM? 10 months 1 week ago #238088

  • cinterpro
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
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

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.056 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!