• Andrew Likens 6
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I have started to try to build this out using process builder and using an invocable method. My work saves, but it is not executing the way I want. Any ideas are greatly appreciated! Code below.
 
public class OBLOppTeamMembers {
@InvocableMethod
    public static void createOBLOppTeamMemberManager(List<OpportunityTeamMember> otmToUpdate) {
        
        List<OpportunityTeamMember> otm = [SELECT Id, UserId, OpportunityId, TeamMemberRole,OpportunityAccessLevel
            							   FROM OpportunityTeamMember 
            							   WHERE Id IN :new Map<Id, OpportunityTeamMember>(otmToUpdate).keySet()];
        
        Set<Id> userIds = new Set<Id>();
        
        for(OpportunityTeamMember oppTM : otm) {
            userIds.add(oppTM.UserId);
        }
        
        List<User> userList = [SELECT Id, ManagerId FROM User WHERE Id IN :userIds];
        
        Map<Id, User> userById = new Map<Id, User>();
                
        for(User u : userList) {
        	userById.put(u.ManagerId, u);
        }
        
        for(Id managerId : userById.keySet()) {
        	for(OpportunityTeamMember oppTM : otm) {
        		OpportunityTeamMember newOppTM = new OpportunityTeamMember();
                newOppTM.UserId = managerId;
                newOppTM.OpportunityAccessLevel = 'Edit';
                newOppTM.OpportunityId = oppTM.OpportunityId;
                newOppTM.TeamMemberRole = 'Regional Manager';
        	} 
        }
        update otm;
    }
}

 
Hello!

I need to create a lightning component that has a form that has two inputs: ChatterGroupId and Notification Frequency. I then need logic to find the chatter group based on the value from the ChatterGroupId input field, find all the chattergroupmembers of that chatter group and update the notification frequency for all the members based on the input from the Notification Frequency input field. Any help is greatly appreciated! Thank you!
I am using a custom email template (HTML) and I am using the {!Opportunity.Amount} merge field in the subject. However, when the email is sent, the currency from the merge field includes a space after the comma, but not in the body of the email, which uses the exact same merge field. I have tried to Google to get answers, but I have found no one else with this issue. I don't know if it makes a difference, but my org has multi-currencies. Screenshot below. Any help/insight is greatly appreciated!

User-added image
I have started to try to build this out using process builder and using an invocable method. My work saves, but it is not executing the way I want. Any ideas are greatly appreciated! Code below.
 
public class OBLOppTeamMembers {
@InvocableMethod
    public static void createOBLOppTeamMemberManager(List<OpportunityTeamMember> otmToUpdate) {
        
        List<OpportunityTeamMember> otm = [SELECT Id, UserId, OpportunityId, TeamMemberRole,OpportunityAccessLevel
            							   FROM OpportunityTeamMember 
            							   WHERE Id IN :new Map<Id, OpportunityTeamMember>(otmToUpdate).keySet()];
        
        Set<Id> userIds = new Set<Id>();
        
        for(OpportunityTeamMember oppTM : otm) {
            userIds.add(oppTM.UserId);
        }
        
        List<User> userList = [SELECT Id, ManagerId FROM User WHERE Id IN :userIds];
        
        Map<Id, User> userById = new Map<Id, User>();
                
        for(User u : userList) {
        	userById.put(u.ManagerId, u);
        }
        
        for(Id managerId : userById.keySet()) {
        	for(OpportunityTeamMember oppTM : otm) {
        		OpportunityTeamMember newOppTM = new OpportunityTeamMember();
                newOppTM.UserId = managerId;
                newOppTM.OpportunityAccessLevel = 'Edit';
                newOppTM.OpportunityId = oppTM.OpportunityId;
                newOppTM.TeamMemberRole = 'Regional Manager';
        	} 
        }
        update otm;
    }
}