A running Personas script could have caused this error
While running SAP Screen Personas flavor on test, A running Personas script could have caused this error. Please check your active scripts javascript errors occured. Since at first, it is not easy to target the Javascript codes causing the error using the SAP Personas error message, I tried to share the steps how I read the hints provided by the SAP Personas error with flavor developers in this tutorial.
Another point that confused me at first when I read the error message is that it indicates a backend error. In fact, the real cause is of course the Javascript codes that I triggerred using the onClick event of the script button controls.
When I highlight a data row listed on the table, the row data is populated on screen elements on the right side of the SAP Personas flavor.
I added 3 script buttons that execute Personas Javascript batches when clicked on each of the Script Buttons.
As seen in following screenshot, when I click on the second or the third script buttons, the SAP Screen Personas user running the flavor gets the following Javascript error.
Backend error occured
A running Personas script could have caused this error. Please check your active scripts.
Received "failed to set value: readonly" on batch step: {"post":"value/wnd[0]/usr/cmb/KODYAZ/SOM_TR_D2C_CONS_CANC_REQ-LOCATION","content":" "}
The complete batch was:
[{"post":"value/wnd[0]/usr/cmb/KODYAZ/SOM_TR_D2C_CONS_CANC_REQ-LOCATION","content":" "},{"post":"action/3/wnd[0]/usr/btnRRA"},{"get":"state/ur"}]
You can debug your scripts using embedded debug tools for developers on your web browsers of course.
But an other way for solving the Javascript error thrown with message "A running Personas script could have caused this error. Please check your active scripts." is reading the hints in the error message itself.
Although "failed to set value: readonly" message is related with the Javascript error causing this message popup, the starting point for a SAP Personas flavor developer should be the last part.
Provided complete batch identifies the cause point of the error in the SAP Screen Personas scripts.
Following code points to the Script Button clicked and the Javascript I added with its onClick event.
{"post":"action/3/wnd[0]/usr/btnRRA"}
Below code takes my attention to combo box related code in the above Javascript code batch.
{"post":"value/wnd[0]/usr/cmb/KODYAZ/SOM_TR_D2C_CONS_CANC_REQ-LOCATION","content":" "}
Let's now check the Javascript codes on development system, that are executed with onClick event of the script button using the Script Editor
OK, a careful eye can find the error at first look.
A set the combobox selected value seen on the screen to an other combobox but this time which is not visible.
Unfortunately, for the cases where script button 2 and script button 3 are active, the combobox which I hide using the flavor editor is disabled on the original transaction screen.
So Javascript codes trying to assign a value to these screen element cause the error.
For me the solution is just to comment the combobox key assignment line.
I hope, SAP Screen Personas developers are now more used to the following message to fetch the hints for the Javascript error debugging.
A running Personas script could have caused this error. Please check your active scripts.