What's new

Welcome to xuiaf | Welcome My Forum

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Salesforce Object key Prefix Record

Hoca

Administrator
Staff member
Joined
Mar 22, 2024
Messages
167
Reaction score
0
Points
16
On this article, we’re going to discover the Salesforce report ID and Object key Prefix. In Salesforce, we’ve the benefit of with the ability to decide the Object kind simply by trying on the File ID, whether or not it’s 15 or 18 digits. Each normal object has a definite prefix (the primary three characters of the report). We are able to decide based mostly on that.

Let’s have a look at one File ID to grasp its format. The ID is 0015g00000NoVcmAAF

Object Key Prefix

Object Key Prefix(KKK):


The important thing prefix is essential in figuring out the article kind. The primary three characters of id are key prefixes. Each normal object has a definite prefix id.

Get the prefix of an Object utilizing Apex:

Utilizing the apex code beneath, we will get the prefix worth dynamically.

Code:
Schema.DescribeSObjectResult r = Account.sObjectType.getDescribe();
String keyPrefix = r.getKeyPrefix();
System.debug('Account key Prefix is ==>' + keyPrefix ); 

19:36:51:003 USER_DEBUG [4]|DEBUG|Sobject key Prefix is ==>001

getKeyPrefix(): This technique returns the article’s three-character prefix code. File IDs are prefixed with three-character numbers that point out the kind of merchandise (for instance, accounts have a prefix of 001 and alternatives have a prefix of 006..)

Equally, in our apex code, we will determine the article identify associated to the report id through the use of the strategy getsobjecttype().

Code:
Id recordId = '0016F00003E2WS0QAN'; 
System.debug('object identify>> '+ recordId.getsobjecttype()); 

19:39:13:002 USER_DEBUG [2]|DEBUG|object identify>> Account

Some record of steadily used normal object prefix codes in beneath Desk

Prod Identifier(PP):


A salesforce ID’s fourth and fifth characters can be utilized for figuring out the PROD or server the report was created on. It represents the group’s occasion quantity. The server/knowledge middle that hosts our group is named a salesforce occasion. For instance, AP24, NA31, and occasion of AP24 is “5g”.

Checking the organizational data will enable us to seek out our occasion of the Org

Navigate to Setup -> Firm Settings -> Firm Info

The salesforce occasion is positioned beneath Group Version in the best column.

Object Key Prefix


Occasion code is an abbreviation for the area. My Org occasion is ‘AP24,’ which suggests it’s within the Asia Pacific area and is served by knowledge facilities in Japan, Kobe, or Yokohama.

Click here to seek out the Occasion standing and knowledge. You’ll get extra concepts by coming into your occasion code.

The third part is RR, which refers to “Reserved for future system use”, The default worth is “0”. And NNNNNNNN – Distinctive alphanumeric identifier, System generates the distinctive alphanumeric values.

The ultimate half is SSS – An elective three-character suffix to make Ids case-insensitive:
As everyone knows, Salesforce makes use of two totally different report ID codecs for various functions: 15-digit and 18-digit. If we glance intently, we will see that the primary 15 characters of each IDs are equivalent, indicating that IDs are case-sensitive. Salesforce makes use of 15-digit IDs which might be case-sensitive; we will discover these ID codecs within the Salesforce person interface. For instance: Reviews

On the subject of 18-digit IDs, they’re primarily utilized by the Salesforce API to switch knowledge between exterior methods. The vast majority of different integrations don’t require case-sensitive IDs.There are at all times three capital letters on the finish of an 18-character ID. These have been generated utilizing the primary 15 characters’ checksum.

For instance, As we all know 0015g00000NoVcm and 0015g00000NoVCM aren’t the identical. Exterior IDs aren’t case-sensitive when utilizing exterior productive instruments comparable to Microsoft Excel, MS Entry, and SQL Server; they don’t differentiate between 0015g00000NoVcm and 0015g00000NoVCM. Salesforce.com has provide you with an 18-digit character insensitive ID after recognizing this difficulty. The 15-character ID quantity is added to create this 18-digit ID, which is case insensitive.

Even Microsoft Excel is unable to determine the above two data as equivalent, which is able to trigger VLOOKUP operations to return incorrect matching values. Salesforce understood that the 15-digit report ID format had limitations. in order that they developed an 18-digit report ID format.
 
Top Bottom