cancel
Showing results for 
Search instead for 
Did you mean: 

Optimized Story Experience - GetResultSet after setfreshpaused(false) doesnt work anymore

Alexander_Blasl
Participant
0 Kudos

Hi experts,

after converting my old classic analytic application to new Story OSE the following code doesnt work anymore.

Table_1.getDataSource().setRefreshPaused(false);
var membersRes = Table_1.getDataSource().getResultSet({"006EIDM3RWZJKVLQMDKLWU6MG":"39217857-8320-4345-9347-722179101763"});
console.log(memberRes);


var "memberRes" is now undefined. It seems the code now doesnt wait for the Table to be loaded. How can I fix that?

View Entire Topic
JefB
Active Contributor
0 Kudos

Maybe these 2 items mentioned in help files could be of any use.
Check if disabling background or viewport loading works better or set drill limit of the table to unlimited.

JefB_0-1716302050355.png

https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/18850a0e13944f53aa8a8b7c094ea29e/834786949212459caabe3... 

 

Alexander_Blasl
Participant
0 Kudos

@JefBwow, I didnt notice that. The problem is definitely lazy loading because of RefreshPaused API. 

Anyway this code helped me out and solved my problem:

Table_1.getDataSource().setRefreshPaused(false);
var maxAttempts = 100;
var attempt = 0;

while (attempt < maxAttempts) {
var membersRes = Table_1.getDataSource().getResultSet({"006EIDM3RWZJKVLQMDKLWU6MG":"39217857-8320-4345-9347-722179101763"});
if (membersRes && membersRes .length > 0) {
console.log(membersRes );
break;
}
attempt++;
for (var j = 0; j < 1000000; j++) { }
}

if (attempt === maxAttempts) {
console.log("Chart loading timed out");
}
console.log(membersRes);