
After Summer 16 upgrade this code fails with inetrnal server error unless I comment out the "insert ashare;" line.System.runAs(systemAdminUser) {
try {
List<Group> tgroup = [Select Id from Group where RelatedId = :territory.Id and Type = 'Territory'];
AccountShare ashare = new AccountShare();
ashare.AccountId = testAccount.Id;
ashare.UserOrGroupId = tgroup[0].Id;
insert ashare;
} catch (Exception e) {
System.debug(e.getMessage());
}
salesForecastList = generateSalesForecasts();
generateSalesActuals();
generateSalesGoals();
}
2 risposte

Thanks pcon. That is what I thought, but support was pushing back a bit, so just doing my due diligence.