Audited field not showing in the change log

We have a relate field in the module and audit is set to true in the studio. But, it is not displaying changes in the log.

If I click on ‘View Change Log’ option and check pop-up screen, the field name shows in the ‘Fields audited in this module’ section.

What is issue? Does anyone know the solution/workaround for this?

Looks like if you edit field from the detail view using inline edit option. It does not get log into change log.

But, if you update field value from the edit view then it will get log into change log.

Could someone please check in their instance and confirm it? :thinking:

Anyone knows it? :thinking: It is bug?

Hi, can you please check if the log data is present in the corresponding db table. You would find the table name something like {MODULENAME}_audit.

Edit: It looks audit log for relate fields doesn’t work when the fields are edited inline. Old and new values not seen different when audit logs data is fetched. So the audit data is absent because of this. I am investigating the issue. I am not sure but there could be an issue in include/InlineEditing/InlineEditing.php file.

I made the following change in include/InlineEditing/InlineEditing.php. This helped me to have audit logs for my related fields when edited inline on detail view page. It requires thorough testing for this solution to be used in production.

	$rel_bean=BeanFactory::getBean($bean->field_defs[$field]['module'], $value);
	$rname=$bean->field_defs[$field]['rname'];
	$bean->$field=$rel_bean->$rname;

Code changes look something like

1 Like

Thank you for reply, this is code file and I think it starts at line 155. I’m using the SuiteCRM 7.13.x version.

sorry, I did not find elseif loop that you mentioned in the above picture.

What am I missing here? :thinking:

Please search saveField method at line 327. elseIf is at line no. 342. Image shows the line nos.

1 Like

Thank you so much :slight_smile: I found that code. In dev, it is logging that change. :partying_face:

Edit: @Harshad could you please make PR and suggest this code change?

1 Like