SAP Knowledge Base Article - Public

3605085 - Error "Cannot read properties of undefined (reading 'trim')" occurs when applying for jobs - Recruiting Management

Symptom

  • Candidates encounter errors when applying for jobs and/or when opening the candidate profile. 
  • errorId=null, timestamp=null, errorMessage=Cannot read properties of undefined (reading 'trim'), errorName=TypeError
  • errorId=null, timestamp=null, errorMessage=b.label is undefined, errorName=TypeError

Environment

SAP SuccessFactors Recruiting Management

Reproducing the Issue

Candidate Profile

  1. Click on View Profile.
  2. An error pops up: "errorMessage=b.label is undefined".

Application

  1. Click on Apply Now.
  2. An error pops up: "errorMessage=Cannot read properties of undefined (reading 'trim')".

Cause

1. Some fields in the Candidate Profile or Job Application Templates do not have default labels and language-specific labels.

When the field label is not translated into the specific language, the system will use the default label to display the field. If the default label is also missing, the error will occur.

2. Some prescreening questions are not translated for the specific language.

Resolution

1. For Field Labels:

Follow the steps below to automatically fix any missing default label without having to locate the field:

  1. Go to Manage Templates > Recruiting Management.
  2. Select Candidate Profile / Job Application.
  3. Edit the template.
  4. Click on "xx Fields defined. Click to modify."
  5. Make a small change to any field.
  6. Click Done.
  7. Publish the template.

To add label translations, refer to the KBA 2932164 - How to change the translation of Field Labels in Manage Templates? - Recruiting Management.

2. For Prescreening Questions:

  1. Open the Job Requisition in Recruiting.
  2. Use the Language dropdown on top right to switch the language (not the locale of the user).
  3. Check if the prescreening questions are translated.

To update a prescreening question, refer to the KBA 2643722 - How to add / edit / import questions on Question Library - Recruiting Management.

Troubleshooting Steps

1. Obtain error logs:

  1. Open the browser developer tool (Press F12 or right-click and select 'Inspect').
  2. Select 'Console' tab in the tool.
  3. Reproduce the error.
  4. In the developer tool, locate the log related to "[ERROR]  Uncaught exception TypeError: Cannot read properties of undefined (reading 'trim')".
  5. Review the error logs for more specific information.

Examples:

  • at RCMProfileInformation.init --> indicates that the error occurred at candidate profile fields.
  • at RCMJobSpecificInfo._init --> indicates that the error occurred at job application fields.
  • at RCMJobAppQuestionSection.init --> indicates that the error occurred at job application prescreening questions.

2. Review field labels in the XML template:

  1. Download the XML template through Manage Templates or Provisioning.
  2. Search for "<field-label mime-type="text-plain"><![CDATA[]]></field-label>" to locate the empty default label.

See Also

KBA 3580449 - Error on Job Requisition in the Internal Career Site

KBA 2932164 - How to change the translation of Field Labels in Manage Templates? - Recruiting Management

KBA 2643722 - How to add / edit / import questions on Question Library - Recruiting Management

Keywords

RCM, Error, Candidate, Job, Application, Apply, b.label is undefined, Field, Label, Template, Translate, Missing, Language, Locale , KBA , LOD-SF-RCM-APP , Applicants and Job Applications , LOD-SF-RCM-CAN , General Candidate Issues (not Offers, not Profiles) , Problem

Product

SAP SuccessFactors Recruiting all versions