create custom fields in cases_audit table and save ip address

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

Parents Reply
  • Hi Ashok Gupta 

    It is not an easy task. Follow the steps to accomplish:

    • Copy the script metadata/audit_templateMetaData.php into custom/metadata/audit_templateMetaData.php and add into custom metadata the field for storing the IP.
    • Edit your config.php and update the attribute $sugar_config['dbconfig']['db_manager'] to 'CustomMysqliManager' (I'm considering your database is MySQL).
    • Copy the file include/database/MysqliManager.php into custom/include/database/MysqliManager.php, update the class name to CustomMysqliManager and make it extends the original MysqliManager class.
    • Remove all existing methods and copy the method MysqliManager from include/database/DBManager.php.
    • Inside this new method setup the value of new field.

    Go to Admin -> Repair -> Quick Repair and Rebuild

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children