Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to call createCube method to get table with 6 rows and 2 columns. I am getting the data in the callback function without any issues. But for some reason the callback method is called more than once and its intermittent. Could someone please help on this?
app.createCube({
"qInitialDataFetch": [
{
"qHeight": 20,
"qWidth": 2
}
],
"qAlwaysFullyExpanded": true,
"qDimensions": [
{
"qDef": {
"qFieldDefs": [
"_ProductDBFieldName"
]
}
},
{
"qDef": {
"qFieldDefs": [
"_ProductUIFieldName"
]
}
}
]
}, function (productReply) {
CreateCubeCallback(productReply.qHyperCube.qDataPages[0].qMatrix, true);
app.destroySessionObject(productReply.qInfo.qId);
});
Hi,
That is the way it is supposed to work. The callback Will be called every time the data changes, for example if the user makes a selection.
Erik Wetterberg
Hi,
That is the way it is supposed to work. The callback Will be called every time the data changes, for example if the user makes a selection.
Erik Wetterberg
Thanks Erik for the reply. Is there any way we can unbind the callback function once the first callback is received?
Hi,
The createCube call returns a promise of a model, so you could do something like:
app.createCube(...).then(function(model){
//do something with the model, like close it....
});
but that might be tricky, you need to be sure you actually got the data before closing, so you will need to try it out.
An easies solution would be to simply ignore all subsequent calls, but that would cost you some performance.
Hope this helps
Erik
Thanks Erik for your response. I am calling the destroysessionobject as soon as the callback is received and ignoring subsequent callbacks.