Summary:
Create a custom entity, called Test for example, then create a simple view on this entity. Ensure that the entity and view are sdata enabled. Now create a simple report based off of this view. Navigate to a company, eg: Gatecom, and select the dashboard tab. Create a new list gadget based on your Test entity report,  the gadget does not work correctly and you get an error saying 'Error while attempting to process the gadget. Please contact your System Administrator':

The same gadget will work correctly however in the regular Interactive Dashboard page in My CRM.


Symptoms:
Custom entity gadget does not work in the dashboard tab of a Company context.


Cause:
The prepared statement in the java application does not correctly populate the WHERE clause of the SQL statement. If you run a fiddler trace of the gadget request you will notice the following error:

<?xml version="1.0" encoding="UTF-8"?><sdata:diagnoses xmlns:sdata="http://schemas.sage.com/sdata/2008/1">
<sdata:diagnosis>
<sdata:severity/>
<sdata:sdataCode/>
<sdata:applicationCode/>
<sdata:message>PreparedStatementCallback; SQL [SELECT COUNT(*) FROM test1notnull WITH (NOLOCK) WHERE ()]; Incorrect syntax near ')'.; nested exception is java.sql.SQLException: Incorrect syntax near ')'.</sdata:message>
<sdata:stackTrace>org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT COUNT(*) FROM test1notnull WITH (NOLOCK) WHERE ()]; Incorrect syntax near ')'.; nested exception is java.sql.SQLException: Incorrect syntax near ')'.&#13;
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:107)&#13;
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)&#13;
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)&#13;
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)&#13;
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)&#13;
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)&#13;
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:662)&#13;


Status:
This is a known bug and has been escalated to development.