function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
notsosmartnotsosmart 

How to find out Lookup Type

I have a custom Lookup that I'm trying to use to replace the Standard Lookup on a Visualforce page.  The code requires reference to the lookup type to associate it to the screen field.  ie  Account is 001.  I got that from a code sample but in order to do this for others, I need to know these codes.  Is there a reference for this?

 

Thanks

sfdcfoxsfdcfox

You could just try to create a new record and look at the first three characters of the ID...

 

Or, if you want to know programmatically, you can do this:

 

system.debug(account.sobjecttype.getdescribe().getkeyprefix());

Replace "account" with your object's name. You can also do this in Visualforce to make custom lookups, etc.