Decoding Salesforce

Decoding Salesforce

The hows and whys of Salesforce.com

How to obtain a field ID

Often people ask me how to get fields IDs in order to build their custom links. I thought it would have been helpful to write a post about this. Let’s see how to get a field ID for custom and standard fields.

Custom Fields

In order to get the ID of a custom field proceed this way:

  • Click on Setup, then on Customize, select the Object you desire (e.g.: Leads) and click on Fields;
  • Click on the name of the custom field you previously created
  • Look at your browser’s address bar, you’ll see something like:
    https://emea.salesforce.com/00N20000000thpj
  • The 15 digit code that appears immediately after https://emea.salesforce.com/ is the ID of that custom field; in this case the ID of the custom field I selected is 00N20000000thpj

Easy enough, isnt’t it :)

Standard Fields

Salesforce.com provides a list of the field’s name for its standard fields, which can be found attached to the solution “How do I create custom links?” and that I decided to paste here as a quick reference:

EVENTS Field Type ID
Assigned To ID evt1_lkid
Text evt1_lkold
Subject evt5
Who Picklist evt2_mlktp
ID evt2_lkid
Text evt2

What Picklist evt3_mlktp
ID evt3_lkid
Text evt3
Private IsPrivate
Activity Currency evt9
Location evt12
Date evt4

Time evt13
All Day Event evt15
Type evt10
Show Time As ShowAs
Description evt6
TASKS Field Type ID
Assigned To ID tsk1_lkid
Text tsk1
Subject tsk5
Due Date tsk4
Status tsk4
Who Picklist tsk2_mlktp
ID tsk2_lkid

Text tsk2
What Picklist tsk3_mlktp
ID tsk3_lkid
Text tsk3
Comments tsk6
Notify by Email email
CAMPAIGNS Field Type ID
Campaign Name cpn1
Type cpn2
Status cpn3
Start Date cpn5
End Date cpn6
Expected Revenue cpn8

Budgeted Cost cpn9
Actual Cost cpn10
Expected Response % cpn11
Campaign Currency cpn7
Number Sent cpn13
Active cpn16
Description cpn4

LEADS Field Type ID
Salutation Picklist name_salutationlea2
First Name name_firstlea2
Last Name name_lastlea2
Company lea3
Title lea4

Lead Source lea5
Industry lea6
Annual Revenue lea7
Campaign ID lea20_lkid
Text lea20_lkold
Description lea17
Phone lea8

Mobile lea9
Fax lea10
Email lea11
Website lea12
Lead Status lea13
Rating lea14
# of Employees lea15

Email Opt Out lea22
Street lea16street
City lea16city
State/Province lea16state
Zip/Postal Code lea16zip
Country lea16country
Use Assignment Rule lea21

ACCOUNTS Field Type ID
Account Name acc2
Account Site acc23
Account Number acc5
Type acc6
Industry acc7

Annual Revenue acc8
Account Currency acc24
Rating acc9
Phone acc10
Fax acc11
Website acc12
Ticker Symbol acc13

Ownership acc14
Employees acc15
SIC Code acc16
Billing Street acc17street
Billing City acc17city
Billing State/Province acc17state
Billing Zip/Postal Code acc17zip

Billing Country acc17country
Shipping Street acc18street
Shipping City acc18city
Shipping State/Province acc18state
Shipping Zip/Postal Code acc18zip
Shipping Country acc18country
Description acc20

CONTACTS Field Type ID
Salutation Picklist name_saluatationcon2
First Name name_firstcon2
Last Name name_lastcon2
Account ID con4_lkid
text con4_lkold

Title con5
Department con6
Birthdate con7
Reports To ID con8_lkid
Text con8_lkold
Lead Source con9
Contact Currency con21

Phone con10
Home Phone con13
Mobile con12
Other Phone con14
Fax con11
Email con15
Assistant con16

Asst. Phone con17
Email Opt Out con23
Mailing Street con19street
Mailing City con19city
Mailing State/Province con19state
Mailing Zip/Postal Code con19zip
Mailing Country con19country

Other Street con18street
Other City con18city
Other State/Province con18state
Other Zip/Postal Code con18zip
Other Country con18country
Description con20
OPPORTUNITIES Field Type ID
Name opp3
Account ID opp4_lkid
Text opp4_lkold
Type opp5
Lead Source opp6
Forecast Category ForecastCategory

Opportunity Currency opp16
Amount opp7
Close Date opp9
Next Step opp10
Stage opp11
Probability opp12
Campaign Source ID opp17_lkid

Text opp17_lkold
Description opp14
CONTRACTS Field Type ID
Account ID ctrc7_lkid
Text ctrc7_lkold
Customer Signed By ID ctrc16_lkid
Text ctrc_lkold
Customer Signed Title CustomerSignedTitle
CustomerSignedTitle ctrc6
Contract Currency CurrencyIsoCode
Price Book ctrc17

Status ctrc15
Contract Start Date ctrc5
Contract Terms(months) ctrc40
Owner Expiration Notice ctrc13
Company Signed By ID CompanySigned_lkid
Text CompanySigned_lkold
Company Signed Date CompanySignedDate

Billing Street ctrc25street
Billing City ctrc25city
Billing State/Province ctrc25state
Billing Zip/Postal Code ctrc25zip
Billing Country ctrc25country
Special Terms SpecialTerms
Description Description

CASES Field Type ID
Contact ID cas3_lkid
Text cas3_lkold
Type cas5
Case Reason cas6
Case Currency cas24

Status cas7
Priority cas8
Case Origin cas11
Visible in Portal cas27
Subject cas14
Internal Comments Cas15
Assignment Rules cas21

Send notification to Contact cas22
SOLUTIONS Field Type ID
Name SolutionName
Details SolutionNote
PRODUCTS Field Type ID
Name Name
Product Code ProductCode
Quantity Scheduling Enabled CanUseQuantitySchedule
Product Currency CurrencyIsoCode
Description Description
Active IsActive
Product Family Family

Revenue Scheduling Enabled CanUseRevenueSchedule
Quantity Schedule Type pQST
Quantity Installment Period pQSI
Number Of Quantity Installments pQSN
Revenue Schedule Type pRST
Revenue Installment Period pRSI
Number Of Revenue Installments pRSN

DOCUMENTS Field Type ID
Name Name
Internal Use Only iuo
Externally Available Image pub
Folder pid
Description desc

Keywords key

Questions? ;)

Popularity: 28% [?]

Advertisement

15 Comments, Comment or Ping

  1. §

    I love you guys.

    By Chris on 6/04/2007 - 18:29

  2. §

    Thanks - this really beats searching through source!

    By Neal on 3/05/2007 - 16:38

  3. §

    I am trying to import Activities but I get the impression I need an ActivityID - where can I find out what these are?

    By Rebecca on 8/05/2007 - 10:52

  4. §

    @Rebecca: how about running a report on Activities including the Activities IDs? :)

    By Ale on 9/05/2007 - 07:35

  5. §

    Hi there,
    How can I find the id for user fields? I am trying to create a user from a contact record and prepopulate some of the fields….
    Thanks

    By Susan on 12/06/2007 - 12:37

  6. §

    …actually I found them. I posted them here if anyone is interested:
    http://community.salesforce.co.....e.id=11864

    By Susan on 15/06/2007 - 12:53

  7. §

    We are using Salesforce.com as a helpdesk application. Currently, we have to enter information in the case close window in order to close a ticket. We need to setup a button on our cases to allow us to bypass this and automatically close a case with generic information. Does anyone know of any code that will allow us to do this? I talked with Salesforce and they told me that we need to set up an S-Control, but that they can’t help me with that. I’m a novice so any help would be appreciated.

    Thanks!

    By Jon on 20/11/2007 - 19:38

  8. §

    the type field on activities is tsk10 much like the event type field evt10

    By Daniel Ruitman on 25/11/2007 - 00:22

  9. §

    Hi

    We have a custom field in Sales Force and a have a simple web-to-lead form on our website that uses ringlead to pass the lead to Sales Force.

    The Custom ID and Name that Sales Force gave us for inclusion on this form (to be attached to the ‘region’ field) is:

    0N30000000mnNj

    This is a nightmare for clientside javacript/ajax validation as

    IT IS NOT WEB COMPLIENT - name an id should not begin with a digit, should begin only with a letter. please see W3 ’s website:

    http://www.w3.org/TR/html401/types.html#type-id

    This is a serious problem as I am unable to write ANY JavaScript validation for this field and subsequently data is lost and leads are not being distributed correctly which is harming our business. Why could sales force not spot this and is there a way to customise this custom field name and id so that at least it starts with a letter???

    Has anyone come against this issue and found a work-around in JavaScript validation???

    Thanks

    By Steve on 19/02/2008 - 11:34

  10. §

    @Steve: Thanks for pointing this out; I believe the forms will post the values to Salesforce if only the NAME attribute contains the actual Id of the field; this shouldn’t prevent you from changing the value of the ID attribute to something more comprehensible (eg: “region”) and validate the field via Javascript using something like: getElementByID(”region”).

    Please let us know if this helps (works).

    By Ale on 19/02/2008 - 16:32

  11. §

    Hi there - minor correction - the Status field is actually tsk12 not tsk4

    By Susan on 6/06/2008 - 12:45

  12. §

    I can’t get custom lookup fields to populate with data using this method, am I missing something?

    By JD on 6/11/2008 - 21:07

  13. §

    Thanks!!!

    By Olof on 28/11/2008 - 13:39

Reply to “How to obtain a field ID”

Subscribe

Feed your RSS reader.