Symptom
- When enabling “Optimized View mode” option in Analytic Application and running the application, it raises errors :
- Script execution failed for event "currency_chart.onResultChanged"
or Script execution failed for event "Page_1.onInitialization" - In Console : Cannot read properties of undefined (reading 'id') TypeError: Cannot read properties of undefined (reading 'id')
Environment
- SAP Analytics Cloud 2025.1.5
Cause
The rootcause of the issue is from the following scripting in Initialization.fcn_initialize_dropdown_div1:
var divMembers = gl_dataSource_sourceChart.getMembers("ZMFWLVL1");
for (var i = 0; i < divMembers.length; i++) {
Drop_Area_Main_Settings_Division_Level1.addItem(divMembers[i].id, divMembers[i].description);
}
if (gl_string_toInitialise === "TRUE" || gl_string_division_1_selectedKey === "") {
Drop_Area_Main_Settings_Division_Level1.setSelectedKey(divMembers[0].id);
gl_dataSource_sourceChart.setDimensionFilter("ZMFWLVL1", divMembers[0].id);
}
DataSource.getMembers cannot make sure the order of members. Members order of classic mode and optimized design mode is different.
The first member id of divMembers is "10" in the classic mode and it's "" in the optimized design experience mode.
Dropdown addItem API cannot accept an empty string as key. It means that "" is not added to Drop_Area_Main_Settings_Division_Level1 and setSelectedKey for "" cannot be selected. The script of currency_chart.onResultChanged reply on the selected key of Drop_Area_Main_Settings_Division_Level1.
Resolution
The solution is to filter out the empty id of divMembers or choose predefined member for Drop_Area_Main_Settings_Division_Level1 :
Filter code:
var tempDivMembers = gl_dataSource_sourceChart.getMembers("ZMFWLVL1");
var dimMembers = ArrayUtils.create(Type.MemberInfo);
for (var j = 0; j<tempDivMembers.length; j++) {
if (tempDivMembers[j].id) {
dimMembers.push(tempDivMembers[j]);
}
}
See Also
- 2569847 - Where can you find SAC user assistance (help) to use, configure, and operate it more effectively?
- Have a question? Ask it here and let our amazing SAP community help! Or reply and share your knowledge!
- 2487011 - What information do I need to provide when opening a case for SAP Analytics Cloud?
- 2511489 - Troubleshooting performance issues in SAP Analytics Cloud
- Search for SAP Analytics Cloud content using SAP for Me, Google or Bing:
- https://me.sap.com/servicessupport/search#?q=SAP%20Analytics%20Cloud%20OR%20SAC&tab=All
- https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fuserapps.support.sap.com+SAP+Analytics+Cloud
- https://www.bing.com/search?q=site%3Ahttps%3A%2F%2Fuserapps.support.sap.com+SAP+Analytics+Cloud
- Note: Add relevant text or warning/error messages to the text search field to filter results.
- SAP Analytics Cloud Connection Guide
- Getting Started with SAP Analytics Cloud Expert Community page
- SAP Analytics Cloud Get More Help and SAP Support
- Need More Help? Contact Support or visit the solution finder today!
Your feedback is important to help us improve our knowledge base.
Keywords
OVM, Optimized View mode, DataSource.getMembers, onResultChanged , KBA , LOD-ANA-AD-INF , Analytics Designer Infrastructure , Problem