TOPIC:

Integration of Breezing Form & SugarCRM/ SuiteCRM 1 year 2 weeks ago #238400

  • medipharm
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 11
  • Thanks: 0
This is probably long solved by now but in case anyone needs it I have just finished connection between BF and SuiteCRM. My solutions is connecting directly to CRM database and it creates Projects, Project Tasks and relationships between them.

So if there is anybody who would want to know how then just let me know - PM or here ;-)

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

Integration of Breezing Form & SugarCRM/ SuiteCRM 1 year 2 weeks ago #238404

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

Thank you for sharing this with the community.

Best regards,

Mihaela

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

Integration of Breezing Form & SugarCRM/ SuiteCRM 3 weeks 6 days ago #250028

  • Calo's Avatar
  • Calo
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 6
  • Thanks: 0
Hello medipharm.

I use since 3 years the SuiteCRM and I would like to create a nice form to send the data to the SutieCRM. Basiccly what I am looking for is to create a simple contact form, the data is inserted into the SutieCRM db and a new lead is created. Once the lead is created the SuiteCRM asssigns it to one user and send out email to notify SuiteCRM user that a new lead is created.
The form will be created with the latest BF in a simple joomla (v3.22) website.
Can you help me out with this please?

Hoping to hear from you again.
Regards,
Paco

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

Integration of Breezing Form & SugarCRM/ SuiteCRM 3 weeks 6 days ago #250032

  • medipharm
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 11
  • Thanks: 0
Hey Calo,

yes sure. Basically - thats exactly what I used it for. In form settings (in breezingforms) you have two tabs. Properties and Advanced. In Advanced you will find Form Options -> More options. Here click on tab Submit pieces and under Begin submit click Type -> Custom. This will be a script thats launched when a visitor clicks on submit button.

In the script then -> you can use something like this:
$this->execPieceByName('ff_InitLib');

// in my case - this is checking out if an order with this number exists in our virtuemart so you probably dont need this
$db = JFactory::getDBO();
$orderNumber = ff_getSubmit('yourOrderNumber');
$db->setQuery("SELECT COUNT(*) FROM #__virtuemart_orders WHERE order_number = '$orderNumber' ");
$oNumber = $db->loadResult();
if($oNumber == 0) {
	echo '<script>alert("Wrong input");location.href="/something";</script>';
exit();
}

// then get data from breezinforms like this (basically just use ff_getSubmit to retrieve data of a particular field from your form)
$data1 = ff_getSubmit('fieldName1');
$data2 = ff_getSubmit('fieldName2');

// then connect a DB of your CRM
define('DB_HOST', 'someURL');
define('DB_NAME', 'somedbname');
define('DB_CHARSET', 'utf8');
define('DB_USER', 'somedbuser');
define('DB_PASSWORD', 'somedbpassword');

// then try to connect
try {
  $pdo = new PDO(
    "mysql:host=" . DB_HOST . ";charset=" . DB_CHARSET . ";dbname=" . DB_NAME,
    DB_USER, DB_PASSWORD, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES => false ]
  );
} catch (Exception $ex) {
  die($ex->getMessage());
}

// if you need to pass date in a way suitecrm understands then its this function:
$currentDate = (new DateTime())->format('Y-m-d H:i:s');

// then you need UUID function (every entry in suitecrm needs to have its own unique UUID) function uuid(){
    $data = random_bytes(16);
    $data[6] = chr(ord($data[6]) & 0x0f | 0x40); 
    $data[8] = chr(ord($data[8]) & 0x3f | 0x80); 
    return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}

// then declare those UUIDs (how much you need) to variables
$uuid1 = uuid(); $uuid2 = uuid(); $uuid3 = uuid(); $uuid4 = uuid();

// insert a new project (or any CRM module) here
$stm = $pdo->prepare("INSERT INTO some_myproject (id, name) VALUES (?, ?)");
$stm->execute([$uuid1, 'some name of new module entry']);

// if you use custom fields in suiteCRM then those are saved in a different table. It always looks like this: the original table is for example: some_myproject and the custom fields created in Studio are then in table some_myproject_cstm. And an used in some_myproject is the same as id_c in some_myproject_cstm. So then your custom fields will be saved like this
$stm = $pdo->prepare("INSERT INTOsome_myproject_cstm (id_c, custom_field_c, custom_date_c) VALUES (?, ?, ?)");
$stm->execute([$uuid1, 'some custom name', $currentDate]);

I hope that covers it ;-)If you have any more questions then just let me know.

Also - be very careful when testing this. Best way is to setup a new CRM instance - something like a CRM demo and test it there first.

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

Last edit: Post by medipharm.
Moderators: ForumSupport
Time to create page: 0.049 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

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!