Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<EntitySubscription> subscription = new List <EntitySubscription>();
- for (Story__c str:story) {
- if(str.Owner__c != NULL){
- subscription.add(New EntitySubscription(ParentID = str.Id,SubscriberId = str.Owner__c));
- }
- }
- try{
- Database.insert(subscription);
- }
- catch (DMLException dmlEx){
- if (dmlEx.getDmlType(0)==statusCode.Duplicate_Value) {
- System.Debug('DevOwnerChatSub: subscription already exists');
- } else{
- throw dmlEx;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement