I am trying to get the last modified time of a data connector (which is an excel sheet) and place it in a label on the dashboard. I have it running on the Ready event but cannot get the code to run past the “getDataConnectorByID” step. I get the below error in the debugger window:
TypeError: Cannot read property ‘getFile’ of undefined
Any help would be appreciated.
debugger;
var connectorId = "55c0b85a-2e29-49cb-831f-4885bbd18450";
connectorId = connectorId.toLowerCase();
var dataConnectorService = new dundas.entities.DataConnectorService();
**var getConnectorPromise = dataConnectorService.getDataConnectorById(connectorId);**
// If successfully retrieved the Connector.
getConnectorPromise.done(
function(lastmodifiedvalue)
{
// Success
label1.labelText = lastmodifiedvalue.lastModifiedTime;
}
);
// If failed to get Connector.
getConnectorPromise.fail(
function(failValue)
{
// Fail
label1.labelText = failValue.responseText;
}
);