I have a below code
public PageReference SyncCandidatewithMirror(map<Id, cxsrec__cxsCandidate__c> NewMap,Map<Id, List<String>> fieldChangedMapChanged, List<cxsrec__cxsCandidate__c> candidateList) {
map<Schema.SObjectField,Schema.SObjectField> mapFieldWiseSchema=new map<Schema.SObjectField,Schema.SObjectField>();
getAllMappingTable('cxsrec__cxsCandidate__c');
list<Candidate_Mirror__c> listCandidateMirrorToUpdate=new list<Candidate_Mirror__c>();
for(cxsrec__cxsCandidate__c can : candidateList){
Candidate_Mirror__c mirrorCandidate = new Candidate_Mirror__c();
for(Schema.SObjectField sjobApp:fieldChangedMapChanged.get(can.Id)){
Schema.SObjectField sJobAppBackup=mapFieldWiseSchema.get(sjobApp);
mirrorCandidate.put(sJobAppBackup, can.get(sjobApp));
}
listCandidateMirrorToUpdate.add(mirrorCandidate);
}
Here I am passing Map<Id, List<String>> fieldChangedMapChanged
in method.
I want to use this inside this for loop for(Schema.SObjectField sjobApp:fieldChangedMapChanged.get(can.Id)){
But I am getting this error Invalid loop variable type expected String was Schema.SObjectField. So I want to Convert List<String>
into List<Schema.SObjectField>
. Please anyone help me to solve this.