Summary:

On adding a list gadget to an interactive dashboard, the following error may appear:

    An error occurred when attempting to load data from CRM

This errow will appear only once, and will prevent a list of source entities from loading for new list gadgets.



Symptoms:

The following exception may appear in the crm.log:

ERROR [http-apr-26009-exec-8]: 05-Feb-2016 16:01:49.160 java.lang.NullPointerException
java.lang.NullPointerException
 at com.sage.crm.core.dao.SecurityManager.isEntityAccessible(SecurityManager.java:408)
 at com.sage.crm.core.dao.SecurityManager.hasPermissionForEntity(SecurityManager.java:506)
 at com.sage.scrm.model.metadata.accessors.CurrentUserAccessor.isCurrentUserPermittedForEntityOperation(CurrentUserAccessor.java:129)
 at com.sage.scrm.model.layout.LandingPageStore.getListOfGadgetEntities(LandingPageStore.java:337)



Cause:

This issue may be caused by a custom entity on the Custom_Tables table. In the case under investigation, this had been added as a primary table, though it pointed at an external database via a view.

This in itself is not the root cause of the issue. The problem was that the entity name (bord_name) did not match the entity caption (bord_caption). When the security lookup was being done for the entity name, a check was being made against a list of entities based on their captions.

When the webapp can’t find the entity name in the list of captions (or, to be more specific, when it doesn’t find an entity object whose name property is equal to the caption), you get a null pointer exception.


Resolution:

The issue can be resolved by changing the entity caption on Custom_Tables so that it matches the name (the view name). An alternative solution is to demote the custom entity to a secondary entitiy, which avoids the security check being made against this entity.