I am running multiple classes and have some Query: FLS Create
issues while running the checkmarx. I am really not knowing what they mean by this. I feel there is something simple but I cannot discern it. Below is my explanation:
Below is my class and exact line:
public class ClassM {
public static void methodM(List<Account> acc){
List<Account> acclst = new List<Account>();
for(Account obj:acc)
{
Account newacc = new Account(); //LINE 8
newacc.Name=obj.Name;
// newacc.Industry='Education';
// newacc.AccountSource=obj.AccountSource;
newacc.BillingCity=obj.BillingCity;
newacc.BillingCountry=obj.BillingCountry;
newacc.Rating=obj.Rating;
acclst.add(newacc); //LINE 14
}
insert acclst; //LINE 16
System.debug('methodM called..');
ClassN.methodN();
ClassO.methodO();
}
}
What are all the checks that I have to do for the lines 8, 14, 16. (I have commented the line number at the end of the line). I shall have to check for field creatable and object creatable i guess. But why is the error also being thrown in the line 14 (when I add account inside the list)?