Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is it possible to get the Id of an object in a Visualforce page without a controller extension?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

You just need to put the object API name and .Id in a formula expression holder? such as:

"{!Opportunity.Id}"

which you can put anywhere in a Visualforce page?

share|improve this answer
1  
Yeah, realized how obvious this answer was right after I posted, thanks for helping me through my not-yet-caffienated morning –  greenstork Mar 18 at 14:49
    
Well, as a concise question and answer pair, it will remain on google for future searchers to find at least! –  Simon Lawrence Mar 18 at 14:50

You can do this using the merge field syntax. For example if you are using the Opportunity standard controller you can use {!opportunity.Id} in your Visualforce page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.