Support Article
Audit note field value displays extra spaces
SA-22619
Summary
When using the CaptionLookup control with parameters included in a field value, the parameters and field value are passed to the function getLocalizedText which generates a localized string. When this string is displayed in an editable text area control, the parameters have a number of extra space characters added to them.
Example field value with parameters (included in the curly {} brackets):

Extra spaces seen at run time:

Error Messages
Not Applicable
Steps to Reproduce
- Add the CaptionLookup control to parameter references in a field value
- Set pyNote with a data transform step which calls getLocalizedText and references the field value
- Ensure that the getLocalizedText function is provided parameters which match the parameters in the field value (see pySetNoteTransfer data transform and assignmentTransfer field value for an example)
- Display the pyNote in an editable text area (example section: pyTransferAssignment)
Root Cause
A defect in Pegasystems’ code causes the generated Java for the CaptionLookup control to be incorrect.
By default, the source for CaptionLookup is formatted to be human-readable (with line-breaks and extra spaces):

Even though the “Omit Extra Spaces” option is checked, the generated Java includes lines generated by the line-breaks and extra spaces:

The left side in the above image is the generated Java for the above example of CaptionLookup, while the right side is generated from a version which has had all human-readable formatting removed.
Resolution
Perform the following local-change:
- Create a new custom control and configure its settings to match CaptionLookup
- Copy and paste the source from CaptionLookup into the new custom control
- Remove any line-breaks or extra spaces from between the angle bracketed elements of CaptionLookup:
- Reference the new control in the field value in-place of CaptionLookup
Published April 29, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.