Rich, the fact that changing from 1000 to 999 made the error go away is very helpful in getting at the cause of the issue.
From all of the troubleshooting steps you’ve taken, and from the error messages that you are receiving, the issue appears to be related at a root level to the evaluation of Sharing upon the Event records in question. I have seen many error messages that occur when non-Admin users attempt to query Models on Standard Objects with a Limit of 1000+ ---- usually these errors surface as “Implementation Restriction: only allows security evaluation for non-admin users when LIMIT is specified and at most 1000”. Here though you’re getting an untrappable Oracle SQLException, which is bad — this needs to be reported to Salesforce as a bug. Salesforce users should never encounter underlying Oracle PL/SQL errors such as the one you’re getting.
However, my guess is that once / if Salesforce were to fix this bug, you would start getting an error something like the “Implementation Restriction” error I quoted above, and that you’d have to have a limit of 1000 records on your Model anyway.
So I think there’s 2 steps to take:
- I recommend reporting this to Salesforce as a bug by logging a case.
- Retain the limit of 999 on your Medical Events model, and in the future make sure that your limits are no more than 999. In general it’s probably not a good user experience to have 1000+ Calendar events showing up for a given Event Source anyway.
I am not sure if you are seeing the same error messages that we are, but here is the error message we’re receiving on our end:
common.exception.SqlDupValOnIndexException: ORA-00001: unique constraint (CORE.AKTMPD_ID2_LIST_IDX) violated Insert into /* ActivitySharingDirect / core.tmpd_id2_list_idx (entity_id) (select contact_id from sales.contact where organization_id = ‘00D0000000ABCD’ and account_id = ‘000000000000000’ and owner = ? union all select c.contact_id from (select /+ ordered no_merge */ distinct s.account_id from core.direct_group_member dgm, core.group_blowout gb, sales.acc_share s where dgm.organization_id = ‘00D0000000ABCD’ and gb.organization_id = ‘00D0000000ABCD’ and s.organization_id = ‘00D0000000ABCD’ and dgm.member_id = ? and dgm.ug_id = gb.component_ug_id and gb.ug_id = s.ug_id ) s2, sales.contact c where c.organization_id = ‘00D0000000ABCD’ and c.account_id = s2.account_id )
where I have inserted 00D0000000ABCD for your company’s actual Org Id — if you send this error message Salesforce in a bug report with a subject something like this, I think it will get their attention:
“Summer 15 causing common.exception.SqlDupValOnIndexException to be thrown”
And then in your bug report paste in the full content of the error message above, replacing 00D0000000ABCD with your actual Org Id, and give them all of the information you’ve given us.