You need to sign in to do that
Don't have an account?

Parsing record IDs
What is the best way (if there is one) to send a record ID to a visualforce page and have the page determine the record type?
The ID could represent a contact record, account record, etc. Do you need to add some javascript to get the DescribeGlobal method and loop thru some metadata and process the ID that way?
Thanks for any info...
Shiztastic
if it is concrete, you can just load that record in your controller and look at the recordtype value.
if dynamic, you may have to loop thru the dynamic (describe) calls to get tokens and check until you have a matching record, then query that record. I've not tried this yet.
Given an incoming Id (which I can retrieve), which may be for any object (and I don't know which, Account, Contact, whatever), how do I retrieve an object so that I can go and fetch the describe information?
ie. I don't know how to start this process given an Id.
Thanks,
Jon
The documentation for describe (page 100 or so) is pretty helpful:
http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf
Jon,
I am doing the same kind of thing. With the Summer 08 release, you can use Apex and the Schema.GlobalDescribe method and DescribeSObjectResult to check out info about the ID. You can use the first 3 characters for the ID to figure out the record type (ie 001 = Account). The metadata can help match record types.
Shiztastic