function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tyler HarrisTyler Harris 

Need to Bulkify Asynchronous Callout

I'm getting a Too many Async calls created on Class.userAddWorkround: line 8, column 1. I have a trigger making an async call to inactivate Contact and vice-versa. I created the class to receive a list of ids to process. I thought the list would 'bulky' enough to process all in 1 call. What am I missing?

Trigger flipPartnerAccess
trigger flipPartnerAccess on Contact (after update) {
    List<User> potentialUsers = [SELECT Id, ContactId FROM User WHERE = 'Partner Community Login'];
    Map<Id, User> emailToUserMap = new Map<Id, User>();
    List<Id> usersToDrop = new List<Id>();
    for(User u : potentialUsers){
        if(u != null){
        emailToUserMap.put(u.ContactId, u);

    for(Contact con :{
        if(con.Status__c =='Inactive'){

    if(usersToDrop !=null){
            userAddWorkRound uak = new userAddWorkRound(usersToDrop);


public class userAddWorkRound {
//Class is a workaround for the MIXED_DML_OPERATION, DML operation error on setup object is not permitted after you have updated a non-setup object (or vice versa): Contact, original object: User
    public userAddWorkRound(List<Id> uid){
        List<Id> UserID = uid;
private static void AdduserAccessObject(List<id> uid){
    List<User> u = [SELECT id FROM User WHERE id = :uid ];  
    if(u.size() != null){
        for(User use:u){
            if(use.IsActive =true){
            use.IsActive =false;
  update u;



Thanks for your help.
Check whether the particular trigger is executed more than once in the same execution flow. Put a debug statement in the trigger code and see how many its trigger is called. There might be an another operation which fires this trigger code again. Check this link to see how to control recursive call -
Tyler HarrisTyler Harris
Hi Karanraj, I put a System.debug('run') and when the trigger fires it only outputs once. 15:30:11:786 USER_DEBUG [3]|DEBUG|run