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

Current DateTime does not display in section

SA-82009

Summary



The DateTime function displays  the function name instead of the current Date and Time in section.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create a section containing a property with a DateTime control
  2. Set the default value with the current DateTime function as below:

    @(Pega-RULES:DateTime).CurrentDateTime()

     
  3. In the Presentation tab, use the Edit option as Read-Only. In the Read-Only value use 'Constant' and set the same function as below:

    @(Pega-RULES:DateTime).CurrentDateTime()

     
  4. On the UI, the DateTime value did not display. Instead, the function displays as a string.


Root Cause



This behavior is as per Pega product design.

When the control is configured to Read-only (always) Constant, the Constant value (the string as it is without any resolution) is displayed. In this use case, the @(Pega-RULES:DateTime).CurrentDateTime() string is displayed, but not the Resolved value.

However, when the above configuration was run in the non-Template mode, the control fetches the value from the property that is bound to the control rather than displaying the Constant value. This property which is bound to the control may possess the current DateTime value always. Hence, the DateTime value is displayed in the non-Template mode. However, in the Template mode, the control picks and displays the mentioned constant string (in this case, @(Pega-RULES:DateTime).CurrentDateTime()).


Resolution



Perform the following local-change in both the Template and non-Template modes:
  1. In the Presentation tab, configure 'Read-only (always) with Property Value'.
  2. In the General tab, bind a DateTime time property reference and populate this value using a data transform to have the current DateTime (data transform > Set {propertyVariable} to @(Pega-RULES:DateTime).CurrentDateTime()').

Published August 15, 2019 - Updated December 2, 2021

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