Newer Version Available

This content describes an older version of this product. View Latest

Change Events for Lead Conversion

Converting a lead results in the creation of an account, a contact, and optionally an opportunity, and also a lead update. When converting a lead, the change event for the lead update includes fields specific to the conversion.

These fields are included in the lead update change event for a lead conversion.

Field Description
Status The lead conversion status. Possible status values are in the LeadStatus standard object.
IsConverted Indicates whether the lead was converted (true).
ConvertedDate The date of the lead conversion. ConvertedDate doesn’t include the time.
ConvertedAccountId The ID of the account created in the lead conversion.
ConvertedContactId The ID of the contact created in the lead conversion.
ConvertedOpportunityId The ID of the opportunity created in the lead conversion.

The change event for the lead update doesn't include the LastModifiedDate field.

For an example lead update change event for a lead conversion, see Lead Update Change Event in the Example section.

Example

These example change events are generated when converting a lead. The order of the change events corresponds to the sequence of operations: the creation of an account, contact, opportunity, and the lead update. The sequenceNumber field in each change event denotes the sequence of the operations in the same transaction.

Account Create Change Event

1{
2  "ChangeEventHeader": {
3    "entityName": "Account",
4    "recordIds": [
5      "0015f00002JUX1JAAX"
6    ],
7    "changeType": "CREATE",
8    "changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
9    "transactionKey": "00006948-0ac9-7da3-edb3-ea0e31b2334a",
10    "sequenceNumber": 1,
11    "commitTimestamp": 1714153779000,
12    "commitNumber": 1100638524517,
13    "commitUser": "0055f000005mc66AAA",
14    "nulledFields": [],
15    "diffFields": [],
16    "changedFields": []
17  },
18  "Name": "Cadinal Inc.",
19  "Type": null,
20  "ParentId": null,
21  "BillingAddress": {
22    "Street": null,
23    "City": null,
24    "State": "IL",
25    "PostalCode": null,
26    "Country": "USA",
27    "Latitude": null,
28    "Longitude": null,
29    "GeocodeAccuracy": null
30  },
31  "ShippingAddress": null,
32  "Phone": "(847) 262-5000",
33  "Fax": null,
34  "AccountNumber": null,
35  "Website": null,
36  "Sic": null,
37  "Industry": null,
38  "AnnualRevenue": null,
39  "NumberOfEmployees": null,
40  "Ownership": null,
41  "TickerSymbol": null,
42  "Description": null,
43  "Rating": null,
44  "Site": null,
45  "OwnerId": "0055f000005mc66AAA",
46  "CreatedDate": 1714153779000,
47  "CreatedById": "0055f000005mc66AAA",
48  "LastModifiedDate": 1714153779000,
49  "LastModifiedById": "0055f000005mc66AAA",
50  "Jigsaw": null,
51  "JigsawCompanyId": null,
52  "CleanStatus": "Pending",
53  "AccountSource": "Web",
54  "DunsNumber": null,
55  "Tradestyle": null,
56  "NaicsCode": null,
57  "NaicsDesc": null,
58  "YearStarted": null,
59  "SicDesc": null,
60  "DandbCompanyId": null,
61  "OperatingHoursId": null,
62  "CustomerPriority__c": null,
63  "SLA__c": null,
64  "Active__c": null,
65  "NumberofLocations__c": null,
66  "UpsellOpportunity__c": null,
67  "SLASerialNumber__c": null,
68  "SLAExpirationDate__c": null
69}

Contact Create Change Event

1{
2  "ChangeEventHeader": {
3    "entityName": "Contact",
4    "recordIds": [
5      "0035f00002EztxDAAR"
6    ],
7    "changeType": "CREATE",
8    "changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
9    "transactionKey": "00006948-0ac9-7da3-edb3-ea0e31b2334a",
10    "sequenceNumber": 2,
11    "commitTimestamp": 1714153779000,
12    "commitNumber": 1100638524517,
13    "commitUser": "0055f000005mc66AAA",
14    "nulledFields": [],
15    "diffFields": [],
16    "changedFields": []
17  },
18  "AccountId": "0015f00002JUX1JAAX",
19  "Name": {
20    "Salutation": null,
21    "FirstName": "Brenda",
22    "LastName": "Mcclure"
23  },
24  "OtherAddress": null,
25  "MailingAddress": {
26    "Street": null,
27    "City": null,
28    "State": "IL",
29    "PostalCode": null,
30    "Country": "USA",
31    "Latitude": null,
32    "Longitude": null,
33    "GeocodeAccuracy": null
34  },
35  "Phone": "(847) 262-5000",
36  "Fax": null,
37  "MobilePhone": null,
38  "HomePhone": null,
39  "OtherPhone": null,
40  "AssistantPhone": null,
41  "ReportsToId": null,
42  "Email": "brenda@cardinal.net",
43  "Title": "CFO",
44  "Department": null,
45  "AssistantName": null,
46  "LeadSource": "Web",
47  "Birthdate": null,
48  "Description": null,
49  "OwnerId": "0055f000005mc66AAA",
50  "HasOptedOutOfEmail": null,
51  "HasOptedOutOfFax": null,
52  "DoNotCall": null,
53  "CreatedDate": 1714153779000,
54  "CreatedById": "0055f000005mc66AAA",
55  "LastModifiedDate": 1714153779000,
56  "LastModifiedById": "0055f000005mc66AAA",
57  "LastCURequestDate": null,
58  "LastCUUpdateDate": null,
59  "EmailBouncedReason": null,
60  "EmailBouncedDate": null,
61  "Jigsaw": null,
62  "JigsawContactId": null,
63  "CleanStatus": "Pending",
64  "IndividualId": null,
65  "Pronouns": null,
66  "GenderIdentity": null,
67  "Level__c": null,
68  "Languages__c": null
69}

Opportunity Create Change Event

1{
2  "ChangeEventHeader": {
3    "entityName": "Opportunity",
4    "recordIds": [
5      "0065f00000UloqVAAR"
6    ],
7    "changeType": "CREATE",
8    "changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
9    "transactionKey": "00006948-0ac9-7da3-edb3-ea0e31b2334a",
10    "sequenceNumber": 3,
11    "commitTimestamp": 1714153779000,
12    "commitNumber": 1100638524517,
13    "commitUser": "0055f000005mc66AAA",
14    "nulledFields": [],
15    "diffFields": [],
16    "changedFields": []
17  },
18  "AccountId": "0015f00002JUX1JAAX",
19  "IsPrivate": false,
20  "Name": "Cadinal Inc.-",
21  "Description": null,
22  "StageName": "Prospecting",
23  "Amount": null,
24  "Probability": 10,
25  "ExpectedRevenue": null,
26  "TotalOpportunityQuantity": null,
27  "CloseDate": 1719705600000,
28  "Type": null,
29  "NextStep": null,
30  "LeadSource": "Web",
31  "IsClosed": false,
32  "IsWon": false,
33  "ForecastCategory": "Pipeline",
34  "ForecastCategoryName": "Pipeline",
35  "CampaignId": null,
36  "HasOpportunityLineItem": false,
37  "Pricebook2Id": null,
38  "OwnerId": "0055f000005mc66AAA",
39  "CreatedDate": 1714153779000,
40  "CreatedById": "0055f000005mc66AAA",
41  "LastModifiedDate": 1714153779000,
42  "LastModifiedById": "0055f000005mc66AAA",
43  "LastStageChangeDate": null,
44  "ContactId": null,
45  "ContractId": null,
46  "LastAmountChangedHistoryId": null,
47  "LastCloseDateChangedHistoryId": null,
48  "DeliveryInstallationStatus__c": null,
49  "TrackingNumber__c": null,
50  "OrderNumber__c": null,
51  "CurrentGenerators__c": null,
52  "MainCompetitors__c": null
53}

Lead Update Change Event

1{
2  "ChangeEventHeader": {
3    "entityName": "Lead",
4    "recordIds": [
5      "00Q5f000005bwLFEAY"
6    ],
7    "changeType": "UPDATE",
8    "changeOrigin": "com/salesforce/api/soap/60.0;client=SfdcInternalAPI/",
9    "transactionKey": "00006948-0ac9-7da3-edb3-ea0e31b2334a",
10    "sequenceNumber": 4,
11    "commitTimestamp": 1714153780000,
12    "commitNumber": 1100638524517,
13    "commitUser": "0055f000005mc66AAA",
14    "nulledFields": [],
15    "diffFields": [],
16    "changedFields": [
17      "0x08F81000"
18    ]
19  },
20  "Name": null,
21  "Title": null,
22  "Company": null,
23  "Address": null,
24  "Phone": null,
25  "MobilePhone": null,
26  "Fax": null,
27  "Email": null,
28  "Website": null,
29  "Description": null,
30  "LeadSource": null,
31  "Status": "Closed - Converted",
32  "Industry": null,
33  "Rating": null,
34  "AnnualRevenue": null,
35  "NumberOfEmployees": null,
36  "OwnerId": null,
37  "HasOptedOutOfEmail": null,
38  "IsConverted": true,
39  "ConvertedDate": 1714089600000,
40  "ConvertedAccountId": "0015f00002JUX1JAAX",
41  "ConvertedContactId": "0035f00002EztxDAAR",
42  "ConvertedOpportunityId": "0065f00000UloqVAAR",
43  "IsUnreadByOwner": null,
44  "CreatedDate": null,
45  "CreatedById": null,
46  "LastModifiedDate": 1714153780000,
47  "LastModifiedById": null,
48  "DoNotCall": null,
49  "HasOptedOutOfFax": null,
50  "LastTransferDate": null,
51  "Jigsaw": null,
52  "JigsawContactId": null,
53  "CleanStatus": null,
54  "CompanyDunsNumber": null,
55  "DandbCompanyId": null,
56  "EmailBouncedReason": null,
57  "EmailBouncedDate": null,
58  "IndividualId": null,
59  "Pronouns": null,
60  "GenderIdentity": null,
61  "SICCode__c": null,
62  "ProductInterest__c": null,
63  "Primary__c": null,
64  "CurrentGenerators__c": null,
65  "NumberofLocations__c": null
66}

The changedFields bitmap field contains the fields that were changed for the lead record. These are the fields contained in changedFields after the Pub/Sub API client decoded this field.

12024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ============================
22024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class -        Changed Fields       
32024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ============================
42024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - Status
52024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - IsConverted
62024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ConvertedDate
72024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ConvertedAccountId
82024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ConvertedContactId
92024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ConvertedOpportunityId
102024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - LastModifiedDate
112024-04-26 10:49:43,114 [grpc-default-executor-1] java.lang.Class - ============================