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
DeveloperSalesforceDeveloperSalesforce 

@Future:System.AsyncException: Future method cannot be called from a future or batch method: HelperclassUpdate.createUserChange(MAP<Id,Boolean>)

Hi,

public with sharing class ScotiaRecruitmentContactHelper {

        @future
        public static void UpdateRecContactRecordType(Set<Id> contactRecords,Set<Id> newUserIds)
         {

     RecordType cRecordType = [select Id from RecordType where Name = 'XXX' and SobjectType = 'Contact' limit 1];
             
              list<User> lstUsers=[select Id,Email,Title,MobilePhone,Phone from User where Id in :newUserIds]; 
          
              for(Contact xCnt : [select User__c,RecordTypeId,email,title,Company_Name__c,MobilePhone,Phone
                                    from Contact  where id in :contactRecords]) {
                  xCnt.RecordTypeId = cRecordType.Id;
                  xCnt.User__c=lstUsers[0].id;
                  xCnt.email=lstUsers[0].Email;
                  xCnt.title=lstUsers[0].Title;
                  xCnt.Company_Name__c='Scotia Home Financing Solution';
                  xCnt.MobilePhone=lstUsers[0].MobilePhone;
                  xCnt.Phone=lstUsers[0].Phone;
                  lstContact.add(xCnt);
              }
              
             system.debug('lstContact'+lstContact); 
             update lstContact;

    }


And one more 

public class UserChangeLogUpdate{
@future
    public static void createUserChangeLogNew (Map<Id, Boolean>
{

}
    insert newUCLog;
}



I have a scenario, where it's updating in trigger and in apex class,
Pls help to recolve:

@Future:System.AsyncException: Future method cannot be called from a future or batch method: HelperclassUpdate.createUserChange(MAP<Id,Boolean>)
ShashankShashank (Salesforce Developers) 
Can you post the code content of the HelperclassUpdate class?