This is a discussion on Query on Lead database - How to get first and last name within the Salesforce Coding Discussions forums, part of the Salesforce category; Hi, I am sure that this is a simple question.
I want
-
Query on Lead database - How to get first and last name
Hi, I am sure that this is a simple question.
I want to pull some basic information from my Lead database, and noticed that First_Name and Last_Name are not valid fields. While I can get Name, and write a function that splits the Name field into first and last names, I am sure that there will be a user that has two first names or two last names and will cause problems.
$query = "SELECT Name, Email, Company from Lead";
Is there a good way to query the SFDC Lead database, or am I stuck writing a php function?
Thanks in Advance,
Adam
-
Hi Adam,
In salesforce you will need to reference the API name for the First Name and Last Name Fields. You can see the API names of a field by doing a describeSObject Call to see what the fieldnames are.
Try this statement:
$query = "SELECT FirstName, LastName, Email, Company from Lead";
Regards,
Adam.
-
Adam,
Thanks that is exactly what I needed!
Adam
Similar Threads
-
By aruljothi2011 in forum Salesforce PHP Tutorials
Replies: 1
Last Post: 06-08-2010, 02:53 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Bookmarks