0

誰か見てくれませんか。以下はコードとエラーです

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、必須フィールドがありません: [名前]: [名前]

4

1 に答える 1

4

名前項目は、Salesforce のほぼすべての標準オブジェクトにあるため、取引先には必須です。名前なしで UI を使用してアカウントを作成できないのと同じように、名前フィールドを次のように設定して、名前を付けずにアカウント レコードを挿入することはできません。

Account acc = new Account();
acc.Name = 'Some Name';
database.insert(acc);
于 2012-06-02T23:21:59.900 に答える