<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/907/create-custom-fields-in-cases_audit-table-and-save-ip-address</link><description>Hi Friends, I want to create a new column (field) inside cases_audit table and store the IP address of users who has modified or changed the audited field. I am using SugarCRM community Edition 6.5.21 . Any input would be of great help. Regards, AKG</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3536?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 13:29:00 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:230cf656-469a-44fc-b7be-4d34a811a1f8</guid><dc:creator>Ashok Gupta</dc:creator><description>&lt;p&gt;Hi Andre Lopes,&lt;/p&gt;&lt;p&gt;Thanks&amp;nbsp;its working now .&amp;nbsp;&lt;/p&gt;&lt;p&gt;I changed the file name to&amp;nbsp;CustomMysqliManager.php from&amp;nbsp;MysqliManager.php inside custom/include/database folder.&lt;/p&gt;&lt;p&gt;Its working now and storing something like &amp;nbsp; ::1 &amp;nbsp;, which I believe for&amp;nbsp;&amp;nbsp;localhost(IP) &amp;nbsp;its stores this way&amp;nbsp;&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;AKG&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3535?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 12:38:09 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:96b1f6b1-88c9-4973-8a83-05a7a678299c</guid><dc:creator>Andr&amp;#233; Lopes</dc:creator><description>&lt;p&gt;Debug the method &amp;quot;getTypeInstance&amp;quot; in the script&amp;nbsp;&lt;span style="color:#000000;background-color:#ffffff;"&gt;include/database/DBManagerFactory.php in order to identify why it didn&amp;#39;t load the custom one.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3534?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 12:19:03 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:2a28ba20-935a-48df-908b-5a7bf348852c</guid><dc:creator>Ashok Gupta</dc:creator><description>&lt;p&gt;I have made the changes and done repair rebuild . But I get an error when we modify &amp;nbsp;config.php and change&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;#39;dbconfig&amp;#39; to&amp;nbsp;&amp;#39;db_manager&amp;#39; =&amp;gt; &amp;#39;CustomMysqliManager&amp;#39;,&lt;/p&gt;&lt;p&gt;Error:&amp;nbsp;&lt;strong&gt;Fatal error&lt;/strong&gt;: require_once(): Failed opening required &amp;#39;include/database/CustomMysqliManager.php&amp;#39;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please let me know if i am missing any thing?&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;AKG&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3533?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 11:29:13 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:4c17534c-95ee-46ef-a0f0-283eb8107c9d</guid><dc:creator>Andr&amp;#233; Lopes</dc:creator><description>&lt;p&gt;My bad!&lt;/p&gt;&lt;p&gt;The method to copy from DbManager is &amp;quot;auditSQL&amp;quot;.&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3532?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 10:35:55 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:c339e75c-10de-429b-a3b8-fc1e6331b143</guid><dc:creator>Ashok Gupta</dc:creator><description>&lt;p&gt;Hi Andre Lopes,&lt;/p&gt;&lt;p&gt;Thanks for your input. i am trying as mentioned above.&lt;/p&gt;&lt;p&gt;I have made the class like class CustomMysqliManager &amp;nbsp;extends MysqliManager&amp;nbsp;&lt;/p&gt;&lt;p&gt;However, point no 4. ie.&amp;nbsp;&lt;/p&gt;&lt;ul style="color:#000000;background-color:#ffffff;border:0px;padding:0px 0px 0px 30px;"&gt;&lt;li style="border:0px;font-weight:inherit;margin:0.5ex 0px;"&gt;&lt;span style="border:0px;font-weight:inherit;"&gt;Remove all existing methods and copy the method&amp;nbsp;MysqliManager from include/database/DBManager.php.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="border:0px;font-weight:inherit;"&gt;&amp;nbsp; &amp;nbsp;I don&amp;#39;t see any method with&amp;nbsp;&lt;span style="color:#000000;background-color:#ffffff;"&gt;MysqliManager name. Can you please confirm?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="background-color:#ffffff;border:0px;color:#000000;font-weight:inherit;"&gt;Regards,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="background-color:#ffffff;border:0px;color:#000000;font-weight:inherit;"&gt;AKG&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3531?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 10:14:50 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:96c4911a-a344-4674-a4cc-7ae014eaf0ee</guid><dc:creator>Andr&amp;#233; Lopes</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://sugarclub.sugarcrm.com/members/ashokinsugar"&gt;Ashok Gupta&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It is not an easy task. Follow the steps to accomplish:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Copy the script&amp;nbsp;metadata/audit_templateMetaData.php into custom/metadata/audit_templateMetaData.php and add into custom metadata the field for storing the IP.&lt;/li&gt;&lt;li&gt;Edit your config.php and update the attribute $sugar_config['dbconfig']['db_manager'] to &amp;#39;CustomMysqliManager&amp;#39; (I&amp;#39;m considering your database is MySQL).&lt;/li&gt;&lt;li&gt;Copy the file include/database/MysqliManager.php into custom/&lt;span&gt;include/database/&lt;/span&gt;&lt;span&gt;MysqliManager.php, update the class name to CustomMysqliManager and make it extends the original&amp;nbsp;MysqliManager class.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Remove all existing methods and copy the method&amp;nbsp;MysqliManager from include/database/DBManager.php.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Inside this new method setup the value of new field.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Go to Admin -&amp;gt; Repair -&amp;gt; Quick Repair and Rebuild&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3530?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 09:42:00 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:ef47839a-4d79-4ffe-b554-012616f2465d</guid><dc:creator>Ashok Gupta</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;Let me know in case of any other information is required. Thanks.&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;AKG&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3529?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 07:14:47 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:73c1e37f-fe3c-490e-9d29-8f571bd8c935</guid><dc:creator>Ashok Gupta</dc:creator><description>&lt;p&gt;Hi Venkatesh Prabhu,&lt;/p&gt;&lt;p&gt;I am creating a report where I need to track from which IP Address users has modified or changed the record.&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Ashok Gupta&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: create custom fields in cases_audit table and save ip address</title><link>https://sugarclub.sugarcrm.com/thread/3528?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 07:09:41 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:4c73f922-ca77-4768-8b87-0cd38d880545</guid><dc:creator>Venkatesh Prabhu</dc:creator><description>&lt;p&gt;Hello &lt;a href="https://sugarclub.sugarcrm.com/members/ashokinsugar"&gt;Ashok Gupta&lt;/a&gt;,&lt;/p&gt;&lt;p&gt;Why you want to store the IP Address in audit table and why not in custom table ?&lt;/p&gt;&lt;p&gt;You can update the field using bean if fields are there in custom table when users modified the field.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>