Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Space issue in correspondence letters after date values

SA-40681

Summary



When a date value with few formats like Date-Long (which displays June 20,2017) are used, a space is getting appended after the value.

Error Messages



Not Applicable


Steps to Reproduce

  1. Configure Correspondence with Date Property.
  2. In correspondence change the format of property to Date-Long.


Root Cause



Error in Date-Long control.

Resolution



Replace Date-Long control (Available rule) with the below code:

<%
tools.putParamValue("DateFormat","4");


ClipboardProperty curProp = tools.getActive();
if ( (curProp.getType() == PropertyInfo.TYPE_DATETIME || curProp.getType() == PropertyInfo.TYPE_DATE) && curProp.size() > 0 && curProp.hasValidValue() && curProp.toDate()!=null) {
String sDatetime="";
String type = tools.getParamValue("DateTimeFormat");
String strTimeZone = "GMT";
sDatetime = PRDateFormat.format(null, strTimeZone, PRDateFormat.DEFAULT_DATE_LONG, curProp.toDate());
tools.putSaveValue("result",sDatetime);

}
else {
String sDatetime="";
Date tempDate = PRDateFormat.parseInternalDateTime(tools.getActiveValue());
if(tempDate != null)//Check if its a valid date time
{

String type = tools.getParamValue("DateTimeFormat");
String strTimeZone = tools.findPage("pxRequestor").getString(".pyUseTimeZone");
sDatetime = PRDateFormat.format(null, strTimeZone, PRDateFormat.DEFAULT_DATE_LONG, curProp.toDate());
tools.putSaveValue("result",sDatetime);
}
else{
tools.putSaveValue("result",tools.getActiveValue());
}
}

tools.getParameterPage().remove("DateFormat");
%><pega:reference name="$save(result)" />

Published October 10, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us