1

I'm writing an integration for a client using the SOAP API in PHP. The client would like to keep notes in Salesforce synchronized with notes in their back office system. In order to do this, I've created a new custom object called ContactNote that contains an External Id field.

I'm running into issues when converting Leads. Leads cannot be the parent in a Master-Detail relationship, so I'm having to use the Notes that are built into Salesforce until the lead is converted. The trouble is that after converting a Lead, I can no longer find the Notes that were associated with that lead. They show in force.com, but when I query for them using SOQL, I get null back.

Where do those notes live after conversion, and how can I retrieve them?

UPDATE: I've discovered that I cannot retrieve any notes via SOQL that I create in salesforce.com. The notes I've created from the Bulk API or through the Developer Console are retrievable.

UPDATE: I may have figured this out. Something to do with having the Beta Notes enabled perhaps.

2 Answers 2

0

The notes are moved into the contact record of the converted lead. You can query for the contact by using the ConvertedContactId contained on converted lead object: "Lead Object Documentation"

3
  • I'm not sure that they are. I've run a bunch of different queries in the Developer Console, none of them return the note I created on the Lead. The two queries that read the Lead and Contact tables do return the Lead and its converted Contact, but not the note that I see in force.com. Queries I've tried: SELECT Id,Title from Note, SELECT Id, Name, (SELECT Id,Title FROM Notes) FROM Contact, SELECT Id, Name, (SELECT Id, Title FROM Notes) FROM Lead Aug 4, 2015 at 14:41
  • I've just completed a vanilla lead conversion with a note and I can confirm that the note is created on both the Account and the Contact. I believe that they re-create the note rather than re-parent it so you'll see different ids. There may be other pieces of code causing the issue if you still don't see the same note in the lead and the contact/account. Aug 4, 2015 at 14:55
  • My bad, the note is no longer attached to the lead. It is transferred to the contact directly and the account. Aug 4, 2015 at 14:56
0

Problem Solved. The Beta version of Notes was enabled, which seems to use a different table. After disabling Beta Notes, I am able to query for notes as expected (excluding any notes that were added while beta was enabled).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .