Error on getDataPage method JS API
I am trying to load data page contents using JS API in js text file rule. But below error appears on browser console;
Uncaught TypeError: Cannot read properties of undefined (reading 'ui')
What causes this error ? I am using exactly the same syntax as described in JS API docs.
https://docs-previous.pega.com/user-experience/86/getdatapage
On browser console, I see pega.api.ui.actions.getDataPage is already defined.