tag:blogger.com,1999:blog-87436813231355766532024-03-14T02:10:47.468-07:00SugarCRMSugarCRM, SugarCRM Problem, SugarCRM Tutorial, SugarCRM PracticeGauravhttp://www.blogger.com/profile/12280116072528926427noreply@blogger.comBlogger3125truetag:blogger.com,1999:blog-8743681323135576653.post-48597145042370057882014-12-09T05:07:00.004-08:002014-12-10T01:14:57.919-08:00Act-on/SugarCRM Integration<div dir="ltr" style="text-align: left;" trbidi="on">
Here is slide that will guide you to SugarCRM integration with Act-on:<br />
<br />
<br />
<iframe allowfullscreen="no" frameborder="0" height="510" marginheight="0" marginwidth="0" scrolling="no" src="//www.slideshare.net/slideshow/embed_code/42512119" style="border-width: 1px; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;" width="477"> </iframe> <br />
<div style="margin-bottom: 5px;">
<strong> <a href="https://www.slideshare.net/GauravVashishtha/act-on-integration-document" target="_blank" title="Act on integration with SugarCRM">Act on integration with SugarCRM</a> </strong> from <strong><a href="https://www.slideshare.net/GauravVashishtha" target="_blank">Gaurav Vashishtha</a></strong> <br />
<br />
For further queries you can contact me.</div>
</div>
Gauravhttp://www.blogger.com/profile/12280116072528926427noreply@blogger.com0tag:blogger.com,1999:blog-8743681323135576653.post-44733996518698445022013-09-30T02:56:00.001-07:002014-11-18T02:02:36.096-08:00SugarCRM Database Query<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Database query functions:</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$bean->db or $GLOBALS[‘db’] or global $db are the objects of the databases.</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// to execute the query</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$result = $bean->db->query($query, true);</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OR</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$result = $GLOBALS['db']->query($query, true);</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<span id="docs-internal-guid-19e9dd48-6e49-11a9-4a26-b18b87fc470b"></span>In this $query variable will have the query that you want to execute.<br />
<br />
<div dir="ltr">
<table style="border-collapse: collapse; border: none;"><colgroup><col width="389"></col></colgroup><tbody>
<tr style="height: 0px;"><td style="border: 0px solid #000000; padding: 7px 7px 7px 7px; vertical-align: top;"><div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: #333333; font-family: 'Courier New'; font-size: 15px; line-height: 1.125; white-space: pre-wrap;">//To get the rowcounts:</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$rowcount = $bean->db->getRowCount($result);</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OR</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$rowcount = $GLOBALS['db']->getRowCount($result);</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This will return the number of rows affected or fetched in the variable </span><span style="color: #333333; font-family: 'Courier New'; font-size: 15px; line-height: 16px; white-space: pre-wrap;">$rowcount</span></div>
<br />
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//To fetch the data:</span><br />
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$resultData = $bean->db->fetchByAssoc($result);</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OR</span></div>
<div dir="ltr" style="line-height: 1.125; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: #333333; font-family: 'Courier New'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">$resultData = $GLOBALS['db']->fetchByAssoc($result);</span><br />
<span style="color: #333333; font-family: 'Courier New'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="color: #333333; font-family: 'Courier New'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;">You can get the all data by the passing the </span><span style="color: #333333; font-family: 'Courier New'; font-size: 15px; line-height: 16px; white-space: pre-wrap;">$resultData variable in the while loop.</span></div>
<div>
<span style="color: #333333; font-family: 'Courier New'; font-size: 15px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<span style="background-color: transparent; color: #333333; font-family: 'Courier New'; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></td></tr>
</tbody></table>
</div>
</div>
Gauravhttp://www.blogger.com/profile/12280116072528926427noreply@blogger.com1tag:blogger.com,1999:blog-8743681323135576653.post-52480794352071557222013-09-30T02:42:00.002-07:002013-09-30T02:42:45.632-07:00Insert the SugarCRM data in relational table<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">To set the relationship and set the data in table:</span></div>
<b id="docs-internal-guid-19e9dd48-6e38-e044-c99d-d0058d896d0e" style="font-weight: normal;"><br /><span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></b>
<b style="font-weight: normal;">To set the data in the relationship table, use the below code.</b><br />
<b style="font-weight: normal;"><br /></b>
<b style="font-weight: normal;">//create the object of the table</b><br />
<b style="font-weight: normal;"><span style="font-family: Courier New, Courier, monospace;">$acc = new Account();</span></b><br />
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//key return by the saved data</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;">$relate_value = array('accounts_contacts_idb' => <span style="font-size: small; line-height: normal; white-space: normal;">$contact_id</span>);</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//key value of related field</span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;">$data_value = array('accounts_contacts_idb_ida' => $_REQUEST['account_id']);</span></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//function call by the same object</span></div>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;">$acc->set_relationship('accounts_contacts_c',$relate_value,true,true,$data_value);</span></span></div>
<div>
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</div>
Gauravhttp://www.blogger.com/profile/12280116072528926427noreply@blogger.com0