0

連絡先のフィールドがtrueにチェックされている場合に、連絡先を取得して潜在顧客として再作成できるセールスフォースのAPEXを更新後に作成したいと思います。どんな助けでも大歓迎です。

ええ、リードに移動する必要がある連絡先のリストを作成する必要があると思います。連絡先からフィールドを取得する形式を忘れているので、それらをリードにマッピングできます。

public void createLead_Update(List<Contact> oldContacts, List<Contact> newContacts) {

System.debug('createLead_Update: entering trigger');

List<ID> createNewLead = new List<ID>();
Lead lead = new Lead(); 
Contact aContact = newContacts[i];


for (integer i=0; i<newContacts.size(); i++) {
// find contacts where the create lead checkbox is checked.
// on update, we care if the value is changed
Contact newValues = newContacts[i];
Contact oldValues = oldContacts[i];
if (newValues.createlead__c != oldValues.createlead__c) {
createNewLead.add(new Lead(
lead.firstName = aContact.firstName));
}
insert new lead
}
  System.debug('createLead_Update: exiting trigger');

    }
4

1 に答える 1