Has anyone developed a working form that will insert data into the SugarCRM database - field by field?
meaning that each field in the form is submitted to the same fields in SugarCRM?
meaning that each field in the form is submitted to the same fields in SugarCRM?
Hi gocasco,
Have you searched here for sugarcrm? I think someone posted about doing it but I'm not sure if they posted the result. It should be fairly staightforward using CURL I think.
Bob
Have you searched here for sugarcrm? I think someone posted about doing it but I'm not sure if they posted the result. It should be fairly staightforward using CURL I think.
Bob
as long as it can be done easily with the CURL plugin then no need for this, the CURL plugin is a multi purpose one!
Cheers
Max
Cheers
Max
thanks for your help Max - I will try and figure it out. I don't know enough about the SQL writing process.
I'll see if I can get some other specifics from the members than have done it.
I'll see if I can get some other specifics from the members than have done it.
Hi gocasco,
You can use the $db2-> approach from the other thread but you'll need access permissions for the SugarCRM database and the field descriptions (names and types).
The CURL approach will only work ik SugarCRM allows you to post data as a 'form' - applications oftne have an API that allows this - I don't know if SugarCRM does.
With any remote app you need to be sure that writing to a table will be OK. From memory Sugar uses several linked tables and you need to make sure that you get all the necessary entries in place.
Bob
You can use the $db2-> approach from the other thread but you'll need access permissions for the SugarCRM database and the field descriptions (names and types).
The CURL approach will only work ik SugarCRM allows you to post data as a 'form' - applications oftne have an API that allows this - I don't know if SugarCRM does.
With any remote app you need to be sure that writing to a table will be OK. From memory Sugar uses several linked tables and you need to make sure that you get all the necessary entries in place.
Bob
OK,
I think I have a basic understanding of:
But I need to write to 3 different tables. How do I set up the above code to do that? And will the information remain linked in the backend of Sugar?
I think I have a basic understanding of:
<?php
<?php
$options = array('host' => 'localhost', 'user' => 'xxx', 'password' => 'xxx', 'database' => 'xxx', 'prefix' = '', 'select' => 'leads');
$db2 =& new JDatabaseMySQL($options);
?>
$db2->setQuery("insert into `leads` (`first_name`,`last_name`,`phone_home`,``primary_address_street`,`alt_address_street`,primary_address_city`,`primary_address_state`,`primary_address_postalcode`,`) values('text_3','text_5');");
?>But I need to write to 3 different tables. How do I set up the above code to do that? And will the information remain linked in the backend of Sugar?
Hi gocasco,
You have stray PHP tags and quotes in there; you are missing some values and the query execution. Here's a revised version:
Bob
You have stray PHP tags and quotes in there; you are missing some values and the query execution. Here's a revised version:
<?php
$options = array('host' => 'localhost', 'user' => 'xxx', 'password' => 'xxx', 'database' => 'xxx', 'prefix' = '', 'select' => 'leads');
$db2 =& new JDatabaseMySQL($options);
$query = "
INSERT INTO `leads`
(`first_name`, `last_name`, `phone_home`, `primary_address_street`, `alt_address_street`, `primary_address_city`, `primary_address_state`, `primary_address_postalcode`) VALUES ('text_3', 'text_5', . . . ) ; ";
$db2->setQuery($query);
$db2->Query();
$query = "
INSERT INTO `some_table`
SET `column1` = 'value1',
. . . ;"
$db2->setQuery($query);
$db2->Query();
$query = "
INSERT INTO `some_other_table`
SET `columnA` = 'valueA',
. . . ;"
$db2->setQuery($query);
$db2->Query();
?>You still need to make sure that the values and fields match up - that's one reason that I prefer the SET syntax.Bob
This topic is locked and no more replies can be posted.
