Issue
After creating a custom Function Alias rule and registering it in the pyGetFunctionAliasesForDataViewsExtension Data Transform, the alias appears correctly in the Calculations list when authoring an Insight. However, when the resulting calculation is added as an Insight column, the operation fails with a generic error. OOTB function aliases (such as pxHourDiff) continue to work without issue.
Symptoms and Impact
Errors observed in the UI:
"Something Went Wrong. Please try again later."
Error returned by the Data Exploration API (HTTP 400 Bad Request):
{
"errorClassification": "Invalid inputs",
"localizedValue": "One or more inputs are invalid",
"errorDetails": [
{
"message": "Error_Invalid_Function_In_Calculation",
"localizedValue": "Calculations should contain only supported functions"
}
]
}
Steps to Reproduce
- Create a new Function Alias rule (Create > Technical > Function Alias), applying it to the Embed-UserFunction class.
- Add the alias to pyGetFunctionAliasesForDataViewsExtension using an Append and Map To step.
- Save and commit both rules to a ruleset version.
- In Insights (), create a new calculation using the custom alias. The alias appears in the Calculations list — this succeeds.
- Attempt to add the calculation as a column in the Insight.
- Observe the Error_Invalid_Function_In_Calculation / "Something Went Wrong" error.
Root Cause
This is confirmed known platform behavior in Pega Platform 25.1.x.
The function alias validation map used by the Data Exploration API (DataAPIUtilsImpl.getFieldFromFunctionMap) is loaded once at server startup. It is not refreshed at runtime when pyGetFunctionAliasesForDataViewsExtension is modified or when a new Function Alias rule is saved. As a result, any alias created or registered after the last server start is visible in the Calculations picker (which reads the Data Transform at runtime) but is rejected by the API validation layer (which reads from the in-memory map loaded at startup), producing Error_Invalid_Function_In_Calculation.
Solution
Primary fix — Server restart (required in Pega 25.1.x)
A single server restart causes the platform to reload the function alias validation map and recognize all aliases registered up to that point.
Steps:
- Confirm the Function Alias rule is saved to a committed ruleset version. Rules left checked out in a branch or personal ruleset will not be loaded.
- Confirm the pyGetFunctionAliasesForDataViewsExtension Data Transform is also saved and committed to a ruleset version.
- Optionally, validate the alias first by referencing it in a Report Definition. A clean validation there confirms the rule configuration is correct before proceeding.
- Perform a full server restart. One restart covers all aliases created up to that point — there is no need to restart once per alias.
- Retest in a new browser session (incognito mode recommended) to eliminate stale session storage.
- Repeat the restart step after promoting the rules to QA or production environments.
Note for Pega Cloud deployments: A server restart requires a Cloud Change request. Submit a Cloud Change following your standard procedures. Do not perform infrastructure or platform-level operations directly.
Checklist Before Requesting a Restart
- Function Alias rule is saved and committed to a ruleset version (not checked out or in a branch).
- pyGetFunctionAliasesForDataViewsExtension Data Transform is saved and committed.
- The alias applies-to class is Embed-UserFunction.
- Pattern field uses numeric positional placeholders ({1}, {2}) — not named placeholders.
- Source SQL expression uses {1}, {2} positional parameters.
- For multi-database applications, a database-specific version of the Function Alias rule exists (use .pyProductType to differentiate, e.g., .pyProductType = ORACLE).
Version-Specific Notes
Pega Platform 25.1.x (25.1.2, 25.1.3): Server restart is mandatory after adding or modifying any custom Function Alias.
Pega Infinity 26 and later: The server restart requirement is removed. After adding a Function Alias, flush the D_pxGetFunctionAliasesForDataViews Data Page or use the Clear Cache option in design-time Explore Data to refresh the function alias map without restarting the server.
References
Specifying custom calculations
https://forums.pega.com/t/error-when-using-custom-calculations-in-insights/12564