Discussion:
DataSource disabled
(too old to reply)
Sascha
2010-06-01 07:20:01 UTC
Permalink
Hello,

I have a form on which I possibly disable a datasource in the code.
But when I click on the "Advanced filter/sort" - icon I get the error
message that the datasource is not enabled.

How can I deactivate a datasource and also be able to call the filter-dialog?
m***@gmail.com
2014-04-24 12:56:05 UTC
Permalink
Post by Sascha
Hello,
I have a form on which I possibly disable a datasource in the code.
But when I click on the "Advanced filter/sort" - icon I get the error
message that the datasource is not enabled.
How can I deactivate a datasource and also be able to call the filter-dialog?
I just stumpled into the same problem:
It is at classes\CueRun\canSaveQueryAsCue

The problem is that it doesn't check if a data source is enabled before trying to fetch a record from the query run object.

My code now looks like this:
static boolean canSaveQueryAsCue(QueryRun qr)
{
int numOfDataSources, i;
QueryBuildDataSource ds;
Query q;
Common cursor;
;
if (!qr)
return false;

q = qr.query();
if (!q)
return false;

numOfDataSources = q.dataSourceCount();
for(i = 1; i <= numOfDataSources; i++)
{
ds = q.dataSourceNo(i);
if(ds.enabled() == false || ds.dynalinkCount() > 0) // <-- remember to check if the data source is enabled
return false;

// Check if it is temp
cursor = qr.getNo(i);
if (cursor.dataSource() && cursor.isTmp())
return false;
}

return true;
}

Loading...