function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
antiuserantiuser 

Creating/updating a "contact list" for mass-mailing

I've never used SalesForce before so I'm sorry if this is a stupid question but looking through the wiki only made me even more confused so I figured I'd ask here.

 

My client has a secure area on his website, where users can apply for access and their data is stored in a MySQL db on his server. When an admin goes in the back-end and enables access for this applicant, their data also needs to be sent to SalesForce so that the client can send them email updates, newsletters and so on. I'm not sure how to set this up as there seems to be many different ways/places in which data can be inserted. Looking for any help I can get... sample code would be awesome.

Best Answer chosen by Admin (Salesforce Developers) 
Park Walker (TAGL)Park Walker (TAGL)

You'll want to create a Contact record to store the information. To do that you will need to associate it with an Account. The Account may just be "Individual" for all of the Contacts or it could be the company that the person is associated with. That's dependent on the way that Salesforce is configured and, hopefully, can be explained by the Salesforce administrator for your client.

 

For the implementation details and plenty of examples you'll probably want to start here and select your language of choice.

All Answers

Park Walker (TAGL)Park Walker (TAGL)

You'll want to create a Contact record to store the information. To do that you will need to associate it with an Account. The Account may just be "Individual" for all of the Contacts or it could be the company that the person is associated with. That's dependent on the way that Salesforce is configured and, hopefully, can be explained by the Salesforce administrator for your client.

 

For the implementation details and plenty of examples you'll probably want to start here and select your language of choice.

This was selected as the best answer
antiuserantiuser

I'll give that a try... the only sample code I found was for inserting accounts, not contacts, which was very confusing. Thanks.

antiuserantiuser

I got it working fine for inserts, but I don't know how to delete a record. All the samples I see just have the delete code tacked at the end of an insert block, so it's just grabbing the resulting Id from the insert. If I query for the Id based on name and email, it gives me a PHP error. How do I delete contacts without knowing the Id? How do I retrieve the Id without first executing an insert?

Park Walker (TAGL)Park Walker (TAGL)

You're on the right track. You need to retrieve the Id and then pass it in the delete call.

 

In order to do that you need to get your query working. If you post the code for the query I'll take a look at it.

antiuserantiuser

I sorted it out, thanks. It's just weird to have to deal with sort of new nomenclature and different ways to get data when I'm used to straight PHP/MySQL. Cheers.