TOPIC:

Has anyone succeeded in intergrat'g BF & SugarCRM? 3 years 9 months ago #183066

  • Topic Author
  • Rajneesh
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Capturing Breezing Form Record ID - SOLVED!

Dear Tome,

Thanks once again. We succeeded in capturing the record ID. Here is the sequence of steps:

Step-1:
Go to Form Pieces>Before Form>custom and add the following code:
//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 dbluminisin_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

Step-2:
Go to your form itself and create a 'hidden input' field, which need to have the name 'recordID' (mandatory). Here is an example:


Step-3:
Go to Submit Pieces>End Submit>custom and add the following code to your original code meant for SuiteCRM/SugarCRM
<input type="hidden" name="breezing_form_rec_id_c" value="'.htmlentities( ff_getSubmit('recordID') ).'"/>

As a result, the composite code for Submit Pieces>End Submit>Custom is:
//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="myresubmit" action="/suitecrm/index.php?entryPoint=WebToPersonCapture" method="POST" name="myresubmit" >
<input name="campaign_id" id="campaign_id" type="hidden" value="13f62ae3-f38d-fe80-a93a-57wrr5670f4b7d" />
<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="first_name" value="'.htmlentities( ff_getSubmit('first_name') ).'"/>
<input type="hidden" name="last_name" value="'.htmlentities( ff_getSubmit('last_name') ).'"/>
<input type="hidden" name="email1" value="'.htmlentities( ff_getSubmit('email1') ).'"/>

<input type="hidden" name="breezing_form_rec_id_c" value="'.htmlentities( ff_getSubmit('recordID') ).'"/>

<input type="hidden" name="somefield4" value="'.htmlentities( ff_getSubmit('somefield4') ).'"/>
<input type="hidden" name="somefield5" value="'.htmlentities( ff_getSubmit ('somefield5') ).'"/>
<input type="hidden" name="somefield6" value="'.htmlentities( ff_getSubmit ('somefield6') ).'"/>
<!-- and so on ... -->
</form>

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

//Section Ends Here

exit;
//You always have to exit the script at the end of  'Submit pieces - End Submit' 

That's about it!

Tome, any idea about capturing the values of multiple selection from checkbox group?

With thanks,

RK
Attachments:

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

Last edit: Post by Rajneesh. Reason: Attention of the reader is brought to the exit of script - Mandatory!

Has anyone succeeded in intergrat'g BF & SugarCRM? 3 years 9 months ago #183068

  • tomeperica's Avatar
  • tomeperica
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 6478
  • Karma: 170
  • Thanks: 667
There you go :)

Regarding checkbox value passing, it will require some time for us to search for best solution.

Once again I encourage you to search for possible solution ;)

Regards,
Tome
Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!

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

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

  • ViralInNature
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
Can't get it to work but I think the problem is I have Joomla and SuiteCRM installed in different databases but same server. What code would I add?

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

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

  • Topic Author
  • Rajneesh
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Dear buddy,

your assumption is wrong !

Joomla as CMS is .....OK
SuiteCRM database is separate from Joomla's database.........OK
Webserver is same..........OK

I have already shared the whole code over here in previous posts wherein mentioned the step-by-step way to follow, but it does not mean pure copy-n-pasting. Take it as a guide!

You may have to identify your user ID and replace it in the code mentioned above. Equally important to have created your campaign first and have its ID and replace it in the code above.

Above suggestion is meant only to encourage you to get the pointers.

Solution has already been implemented.

Kindly dig a little deeper.

With thanks,

Rajneesh

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

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

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

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 #206875

  • Topic Author
  • Rajneesh
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 75
  • Thanks: 0
Your form ID is <form id="WebToLeadForm"...........

your submission snippet should be:
document.getElementById("WebToLeadForm").submit();

TEST it

Rajneesh

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

Moderators: ForumSupport
Time to create page: 0.826 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!