Home > apex error code 29

How to fix Apex Error code 29?

Alton Alexander
By Alton AlexanderUpdated on June 4th, 2022

Apex error code 29 occurs when an attempt is made to create or update a record that would cause a duplicate value in a field that has been marked as unique. This error can occur when a user attempts to create a new record with a value that already exists in the field, or when an existing record is updated to have a value that matches another record in the field. This error can also occur when a record is imported from a CSV file or other external source if the data in the field contains duplicate values.

Other common searches for this error include:

  • apex legends error code 29
  • error code 29 apex legends
  • apex error code 29

1. Check for invalid field names in your SOQL query

  1. In your apex code, check for invalid field names by using the SOQL query editor.
  2. If you find any invalid field names, you will need to fix them.
  3. You can fix invalid field names by using the SOQL editor or by using the Apex code editor.
  4. If you need help fixing invalid field names, you can contact your system administrator.

2. Check for invalid field names in your SOSL query

  1. Verify that all of the field names in your SOSL query are valid.
  2. If any field names are invalid, use the apex code 29 to indicate that the query is invalid.
  3. Correct any invalid field names in your SOSL query, and then re-run the query.

3. Check for invalid field names in your Visualforce page

  1. In the Apex window, select the page you want to check.
  2. In the Apex window's left toolbar, click the Page Properties button.
  3. On the Page Properties page, in the validation section, click the Validate button.
  4. In the Validate window that opens, select the Fields tab.
  5. In the Fields tab, make sure that all the field names are valid. If they're not, fix them and click the OK button.
  6. In the Validate window, click the OK button.
  7. In the Apex window, click the Save button.

4. Check for invalid field names in your Apex code

  1. In your Apex code, identify any fields that appear to be invalid.
  2. If any of the field names appear to be invalid, try to fix the field names using the correct Apex code syntax.
  3. If the field names still appear to be invalid, then you may need to fix the field values using the correct Apex code syntax.

Still not working? maybe try one of these options:

  1. Check for invalid field names in your custom settings.
  2. Check for invalid field names in your custom metadata.
  3. Check for invalid field names in your profile.
  4. Check for invalid field names in your permission set.