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

2 Answers 2


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


which you can put anywhere in a Visualforce page?

  • 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, 2014 at 14:49
  • Well, as a concise question and answer pair, it will remain on google for future searchers to find at least! Mar 18, 2014 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .