You need to sign in to do that
Don't have an account?
DeveloperSalesforce
@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>)
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>)
Shashank (Salesforce Developers)
Can you post the code content of the HelperclassUpdate class?