Questions tagged [salesforce-id]

A Salesforce ID is the primary key field for any object. It is a primitive type in Salesforce. Salesforce Ids come in 15-character and 18-character "case safe" varieties, which are treated as equivalent by all APIs.

Filter by
Sorted by
Tagged with
164 votes
4 answers
60k views

What are Salesforce ID's composed of?

I remember seeing somewhere that IDs are composed of a few pieces. I always have a hard time trying to find that information when I'm looking for it. What I mean by the above is that the various ...
Ryan Elkins's user avatar
  • 7,607
43 votes
27 answers
20k views

How can I convert a 15 char Id value into an 18 char Id value?

What is the formula for calculating the additional 3 characters needed to append to a 15 char Id in order to form its equivalent 18 char Id? I have a situation where I need to compare 15 char Ids (...
Yaakov Ellis's user avatar
  • 1,459
42 votes
1 answer
122k views

How do I build a SOQL query for records in a list of IDs?

Can some one correct my soql? I need to export records in data loader like: WHERE Id IN ('123123123','123123fsdf') But this following query does not work for me: SELECT Id, Syndication_Documents__c ...
sfdc's user avatar
  • 13.5k
31 votes
1 answer
91k views

Can anybody explain the UNABLE_TO_LOCK_ROW error?

Error Message: Developer script exception from Nicomatic : quotepotential : quotepotential: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with ...
Teja's user avatar
  • 1,412
26 votes
2 answers
16k views

Database.SaveResult.getId() returns null

I'm trying to update an account list and I need to get the Ids when the update fails. I use the getId() method but for accounts which fail I get null. It's an update so my account already has an Id. ...
SF_user's user avatar
  • 3,586
22 votes
1 answer
27k views

How do I query queue ID in Apex?

How do I query queue ID in Apex? Known parameters: Queue Name Supported object Miscellaneous information: The reason I need queue ID in Apex because my routing logic assigns selected records to a ...
Shumon Saha's user avatar
  • 4,592
21 votes
4 answers
7k views

SOQL where clause use 15-character ID?

Can anyone confirm this: in a SOQL Where clause, when comparing an ID field to a 15-character string variable, the comparison works. I didn't expect it to work, but it does and I am surprised. I can'...
David Cheng's user avatar
  • 6,880
18 votes
1 answer
3k views

What are the Salesforce Pod ID to instance mappings?

As per What are Salesforce ID's composed of?, the 4th and 5th character of a Salesforce ID can be used to identify which pod/server the record was created on. Note that due to events like pod ...
Daniel Ballinger's user avatar
16 votes
5 answers
25k views

can we check if a key exists in a map in vf page

is it possible to check for a specific key in a map i.e., whether it exists or not in VISUALFORCE page? Based on this i need to render a pageblocktable.
rani's user avatar
  • 211
16 votes
1 answer
26k views

Get SObject by Id

I have an Id and I want to know if it's possible to get the SObject with this unique ID ? Something like : SObject object = getSObjectById(myId); I didn't find a method allowing that !
SF_user's user avatar
  • 3,586
15 votes
2 answers
31k views

How to Convert 18 char Id to 15 char Id using substring in Apex trigger

I have a trigger where i am assigning ID to a cusotm field like below - D.customfield__c = acc.Id; The ID is coming as 00P28000000EwpjEA0 But i need only 00P28000000Ewpj 15 char. Is there is a way ...
sfdc_to_learn's user avatar
15 votes
2 answers
2k views

Does anybody have a good way of mapping a key prefix to an object type?

I want to be able to reliably take an ID and map it to the appropriate object type so I can query the object in question. Before now I've tried using the global decsribe info, looping over the ...
Matt Lacey's user avatar
  • 25.1k
15 votes
1 answer
8k views

Finding a Custom Object Id (01I...) to get the Setup page URL

I'm trying to find a way to get the "Id" for a custom object's setup page. So I'm NOT trying get a record Id. I'm working on a custom visualforce page and I'm setting up a link so that when the user ...
user7702's user avatar
  • 343
14 votes
6 answers
2k views

Converting uppercased 18-digit Id to valid Id

I am currently facing an issue where an external system passes back an 18-digit Id that our platform has previously sent to them. However in the process the capitalization of the Id has been removed - ...
Koen Faro's user avatar
  • 773
14 votes
2 answers
15k views

How to get an 18 digit ID from 15 digit ID using SOQL

I have a 15 digit Sfdc ID, but I do not know which object it belongs to. How can I find out which objects it belongs to and the convert it to 18 digits - all using SOQL? P.S. I was annoyed at having ...
AngryHacker's user avatar
  • 1,481
14 votes
2 answers
5k views

Are SObject Id's sequential & should they be used for defining batches in a large data retrieval?

Are Salesforce ObjectIds (15/18 char) guaranteed to be sequential, based on create date? In other words, would the following queries return the same sequence of items?: 1. Select Id from Account ...
Yaakov Ellis's user avatar
  • 1,459
13 votes
1 answer
11k views

Populating lookup fields using an external ID

I have an lookup field in my opportunity object which is pointing to a custom object called Code__c. Code__c has an external Id field called Code_Source__c. When creating an opportunity once way of ...
Yash Mehta's user avatar
  • 1,515
12 votes
2 answers
3k views

Creating a link using an 18 character ID

I have an 18 character SFDC ID. I was under the impression that I should be able to create a link to that record using the following pattern: https://<org server>.salesforce.com/<id> For ...
Ryan Elkins's user avatar
  • 7,607
12 votes
4 answers
4k views

Converting the Salesforce Pod Id to ServerUrl/Name

Given a Salesforce Org Id, how can I determine the name and serverUrl to use with APIs?* For example, given the Org Id 00DE00001234ooT I can get the Pod/Server identifier from the first character ...
Daniel Ballinger's user avatar
12 votes
3 answers
9k views

How to access and not hardcode the field ID for a custom object? Using Apex, to construct URLs

Lets say you wanna create a new instance of a custom object, lets call this Custom Object Relationship_Detail__c. You are trying to create a link where it takes you to the proper RecordTypeId and it ...
user10009's user avatar
  • 171
12 votes
2 answers
308 views

Any documentation or insight on the "empty id string"?

This answer (from Nathan Pike a Salesforce developer) mentions the idea of an "empty id string" that can be appended to the 3 digit key prefix. I've wanted an ID that matches nothing but is ...
Keith C's user avatar
  • 134k
11 votes
4 answers
10k views

Is it possible to insert multiple records in Salesforce using cURL at the same time?

I am using cURL to insert data into salesforce. It works with single record but I need to insert multiple records at a time. Is it possible to do so and is it possible via a REST interface?
Vineeth's user avatar
  • 1,076
9 votes
1 answer
12k views

Convert Date to milliseconds and milliseconds to Date

I am getting date into JSON as below : date=1382166999 It seems that date has been returned in milliseconds format. Can anyone please suggest the way to convert it into normal date format and vice ...
S.Sharma's user avatar
  • 1,627
9 votes
2 answers
9k views

How to update parentID on Attachments in Salesforce

I need to move Attachments from one SF to another SF, but the final parent object is not in the destination org. So I've created temporary records and plan to update the ParentId of the attachments ...
Chirag Verma's user avatar
9 votes
3 answers
3k views

is of 18 digit ID really case insensitive?

As per documentation(or should i say popular belief ... as i did not find exact documentation link) 18 digits are case insensitive and 15 digit ids are case sensitive. In fact many site blogs says ...
AtulRajguru9's user avatar
  • 9,090
9 votes
2 answers
9k views

Ids in Salesforce - Same across environments?

Let us say, I have a recordType for an object in Production. Assuming RecordTypeId is a12345678, if I "refresh" a sandbox (Not a full copy sandbox), the recordType will be created in the refreshed ...
sfdcFanBoy's user avatar
  • 4,019
9 votes
1 answer
152 views

Can an Object Definition's ID be obtained programmatically?

I've noticed that SF related lists are anchored (#) by a concatenation of the current record's Id, an underscore, the Id of the related list's object definition, and then "_target" (e.g. #...
Patrick's user avatar
  • 193
8 votes
2 answers
3k views

Set CreatedById Field in Apex Test Class

I have created a trigger on the Account object that is validated only if the records are being created by an non-admin account. In order to test this functionality I would have to set the ...
Marc Zaharescu's user avatar
8 votes
2 answers
5k views

How to pass a variable to the SOQL where clause?

I am using Salesforce API with C#. In the query that I am writing I am not sure how to pass a parameter to the select statement. My query works when it looks like this: SOQL = "select AuthorId,Name, ...
Alma's user avatar
  • 223
8 votes
1 answer
12k views

Rerender a pageBlock if a value is entered in an inputField?

I want to rerender a pageBlock by checking whether the inputField is null. If it is not null, then it should rerender the pageblock. I wrote the code, but the page block which needs to be rendered is ...
AnuRaj's user avatar
  • 2,472
7 votes
3 answers
378 views

Distance between Salesforce ID indicates activity of other tenants

Question Does the distance between two Salesforce IDs indicate how many records have been created by other orgs? Approach Assuming I create a scheduled job that creates an Account periodically. The ...
Christian Deckert's user avatar
7 votes
2 answers
24k views

Calling a Apex controller method using JavaScript in VF page

Hi can anybody guide me how to call a method in controller from a VF page.
AnuRaj's user avatar
  • 2,472
7 votes
3 answers
4k views

Is there a way to change a Salesforce ID?

Salesforce generates and manages the 15-18 character Salesforce IDs for objects in their system. We are getting a super weird error where our system can't handle an ID coming in from a customers ...
Joshua Dance's user avatar
  • 1,623
7 votes
2 answers
1k views

Does salesforce assign Ids of deleted Records to new records?

For ex: If I create a new Account, does salesforce algorithm always generate a new record Id or it looks for any of the old deleted record and assigns that Id?
javanoob's user avatar
  • 8,627
7 votes
3 answers
3k views

Find out if a given string is Salesforce Id in Java

Is there a way(regex or something) to find out if a given string is a Salesforce Id or not? I'm looking for some helper class in Java.
Vignesh Damodharan's user avatar
7 votes
1 answer
2k views

What will happen with the Salesforce Pod identifier when there are more than 62 instances?

Currently the pod instance that a record is created on is encoded in the 4 character of the ID, immediately after the key prefix. There are some more details about the Pod identifier in the question ...
Daniel Ballinger's user avatar
7 votes
1 answer
1k views

How do I get the user details when authenticating with OAuth 2.0?

I am using DotNetOpenAuth libraries to implement OAuth 2.0 client side to communicate with SalesForce authorization server. I have finished first two steps of OAuth 2.0 communication that ends with ...
Rastko's user avatar
  • 931
6 votes
2 answers
3k views

Issue with using ContactID as subscriber key in Marketing Cloud

We have set up our Sales Cloud - Marketing Cloud integration where Contact ID is used as the subscriber key. What we've noticed is when we have contact ID as the subscriber relationship on our ...
MikeT's user avatar
  • 71
6 votes
2 answers
3k views

From SOQL, Truncate Id 18 to 15 - Cased Correctly?

If I query for a record and get back its Id, I get 18 characters. However, support has informed me that for the purposes of testing, the setProcessDefinitionNameOrId method will only work with a 15 ...
Adrian Larson's user avatar
  • 148k
6 votes
3 answers
6k views

How to get salesforce Ids for fields from apex using Schema methods?

I tried this approach, but the Salesforce Id is not being returned by getDescribe method. Schema.DescribeFieldResult field = Schema.SObjectType.Account.fields.Name; system.debug(' Account field, \'...
zuke's user avatar
  • 730
6 votes
1 answer
1k views

Toggle Comments shortcut key

I am looking for the shortcut to be able to toggle comments in Force.com IDE. I use it often in the regular flavour of eclipse and other IDEs. Looking at the preferences page, it seems like I should ...
lindon fox's user avatar
6 votes
2 answers
824 views

Check if a .txt file of IDs all exist in Salesforce

I receive a .txt files of type ID, e.g. 003U000000PL9LN, 001U000000PL9LM, a1fU000000PL9LO. I need to check if these IDs correspond to valid objects within Salesforce. I have a List of IDs in Apex. ...
George S.'s user avatar
  • 2,700
6 votes
2 answers
4k views

Required fields are missing:

I am writing a test class. When i run my test class i am getting an error System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are ...
AnuRaj's user avatar
  • 2,472
6 votes
5 answers
532 views

Identify component type from ID

I am curious to know, is there any way exists from where we can know that a particular id is of type VF/class/trigger/components etc. The way I think/know currently is, to query with "ApexPage" to ...
Ysr Shk's user avatar
  • 3,034
6 votes
1 answer
992 views

Are object Id's globally unique across an organization?

Is it safe to say that an ID for an object in Salesforce is guaranteed to be unique across all objects for an organization? I ask this since id's for objects are prefixed with the keyPrefix value ...
contactmatt's user avatar
  • 1,039
6 votes
2 answers
7k views

Get the ID of a lookup field for Onclick Javascript Button

I am trying to get the ID of a lookup field so I can populate a field on a new record that is created when an Onclick Javascript button is clicked. Basically I need the ID of Birth_Record_c.Dame_c ...
Jennifer's user avatar
  • 179
6 votes
1 answer
3k views

userinfo.getuseremail() returns noreply@salesforce.com in salesforce

I have created a package in salesforce that will make an http callout request with user's email id to get data for that email and add the data to some custom object. But when I tried using UserInfo....
sPaz's user avatar
  • 299
6 votes
1 answer
95 views

Does SObjectType Access Guarantee Id Access?

I am writing a fluent query builder which I hope will pass security review, and I still have a few nagging questions. I will refrain from asking more than one question per question, so right now, what ...
Adrian Larson's user avatar
  • 148k
6 votes
1 answer
2k views

understanding salesforce licensing for development and deployment

I am trying to understand the licensing issues on I would come across on Force.com for developing an application that will have its own data source and will also be pulling data from SalesForce.com ...
user1798455's user avatar

1
2 3 4 5
13