0
有人可以看看它。下面是代碼和錯誤必填字段missng錯誤
global void execute(
Database.BatchableContext BC,
List<sObject> listObj){
list <Account> inAcc = new list<Account>();
for (sObject lo : listObj){
Unprocessed_Agreement__c temp = (Unprocessed_Agreement__c)lo;
inAcc.add(processor.processAccountRecord(temp));
}
insert(inAcc); // This line throws the error
}
處理器類看起來是這樣的
global class CreateAndModifyProcessor {
global Account processAccountRecord(Unprocessed_Agreement__c temp){
Account tempAcc = new Account();
tempAcc.Begining__c = temp.Begining__c;
tempAcc.Agreement_ID__c = temp.Agreement_ID__c;
return tempAcc;
}
}
第一個錯誤:插入失敗。第0行的第一個例外;第一個錯誤:REQUIRED_FIELD_MISSING,缺少必填字段:[Name]:[Name]