Health Check Error: Found customCode
Overview
The Health Check wizard must be run when upgrading in order to evaluate your instance's ability to move to the target version. During the health check, various types of issues may be detected which can affect your ability to upgrade. This article will cover how to resolve a "Found customCode" error reported by the health check.
Symptoms
This error generates an output similar to the following in health check:
This error will occur under the following circumstances:
- A custom button was created and installed by a developer, which includes custom functionality.
- Changes were made to the Edit View and Detail View layout in Studio, which created the 'customCode'.
Resolution
The generated error message will help determine the contents of the file causing the health check error. To address this issue, the code-level customization will need to be edited from Sugar before proceeding with the upgrade. The following sections will cover potential scenarios which can trigger this error and how to resolve it properly.
'customCode' in a Buttons Array
The first example involves customCode
found in a buttons array that is triggering the error.
Breakdown of health check error:
- The file causing the error can be found in
./custom/modules/Contacts/metadata/detailviewdefs.php
. - The health check detects an issue in the following sub-array:
The code triggering the health check error is found in index 4 of the buttons
array. To address this error, the custom code will need to be commented out or removed from the file. The corrected file should look like:
'customCode' in a Field Definition
The second example involves customCode
in a field definition that is triggering the error.
Breakdown of health check error:
- The file causing the error can be found in
./custom/modules/Opportunities/metadata/detailviewdefs.php
. - The health check detects an issue with the following array:
The customCode
in this array is triggering the health check error. To address this error, the custom code will need to be commented out or removed from the file. The corrected file should look like:
If the customCode
was created by a developer, the functionality will be lost during the upgrade process. If the customCode
was created by saving a layout in Studio, the functionality will be re-written during the upgrade process since the Edit View and Detail View layouts are merged into a single Record View layout in Sugar 7 and above's Sidecar modules.
Once the necessary change has been made, please navigate to Admin > Repair and perform a "Quick Repair and Rebuild" to ensure that the changes are synced between the application and database. Then, perform the health check again to confirm that the error is no longer reported.