+ Reply to Thread
Results 1 to 3 of 3
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
  1. #1
    adam.cadieux is offline Junior Member
    Join Date
    Sep 2011
    Posts
    2

    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

  2. #2
    Adam Best is offline Junior Member
    Join Date
    Apr 2011
    Posts
    10
    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.
    Regards,
    Adam

    Into Joomla! and SalesForce?
    Check us out below at
    http://www.miiworks.com/

  3. #3
    adam.cadieux is offline Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Adam,

    Thanks that is exactly what I needed!

    Adam

+ Reply to Thread

Similar Threads

  1. Salesforce PHP MySQL Database Replication Tool ( database without content)
    By aruljothi2011 in forum Salesforce PHP Tutorials
    Replies: 1
    Last Post: 06-08-2010, 02:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.2