Opportunities_audit stopped saving data

I am trying to find change logs for a opportunity record but in opportunities_audit table last saved record is from 1 years ago, not sure if anyone disabled functionality but how to enable audits for opportunity.

there is a way to do this (I don’t know how to do this via CRM interface)
you can go to custom/Extension/modules/Opportunities/Ext/Vardefs
create a php file with name _override_enable_audit.php
and put the following code

$dictionary['Opportunity']['audited'] = true;

Search through this folder if any file has code where this field is being set to false. it would be better to comment out that line

Hey @abuzarfaris Thanks. Can you share sample name _override_enable_audit.php
and do we need to mention this file anywhere else for including these changes.

you need to create the new file and following are the entire contents of the file

$dictionary['Opportunity']['audited'] = true;

You just need a Quick Repair and Rebuild, it will be picked up automagically.

Just wanted to reconfirm, we do need to add closing php bracket in code, right

<?php $dictionary['Opportunity']['audited'] = true; ?>

It’s not necessary . The code work without the ending ?> As well

I have added this code but still not able to view change logs for an opportunity that i just updated.

I have also searched for

$dictionary['Opportunity']['audited'] = true;

In code but did not get this anywhere

In fact, using the closing ?> is not recommended. You can google for an explanation.

To search the code, I suggest this, run it from the SuiteCRM root directory:

grep -irn audited . | grep -i oppo

the difference is that it will catch more variations of how the code is written.

Is there any way through UI, i am trying to enable change log for opportunity but somehow could’nt find exact code to modify or any place where it wil surely override config

checked via grep -irn audited . | grep -i oppo as well

A sure way to check whether your opportunities are audited is to Repair and rebuild
Then go to file
if you see that audited is true like below
and still you are not seeing audit logs then your issue is somewhere else

1 Like
'sales_stage' => 
    array (
      'name' => 'sales_stage',
      'vname' => 'LBL_SALES_STAGE',
      'type' => 'enum',
      'options' => 'sales_stage_dom',
      'len' => 100,
      'audited' => true,
      'comment' => 'Indication of progression towards closure',
      'merge_filter' => 'disabled',
      'importable' => 'required',
      'required' => true,
      'inline_edit' => true,
      'comments' => 'Indication of progression towards closure',

 $GLOBALS["dictionary"]["Opportunity"]=array (
  'table' => 'opportunities',
  'audited' => true,
  'unified_search' => true,
  'full_text_search' => true,
  'unified_search_default_enabled' => true,
  'duplicate_merge' => true,
  'comment' => 'An opportunity is the target of selling activities',

Its set as true, Do we need to clear cache or clear table data for opportunities_audit

If the issue is still not fixed it is not related to audited flag
Please look in suitecrm logs for more information
Here are the logs