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
sri sfdcsri sfdc 

vf page id

How do I know current vfpage id in apex class?
Best Answer chosen by sri sfdc
sharathchandra thukkanisharathchandra thukkani
You need to use Apexpages.currentpage().getUrl() in the controller to get the name of the VF page and using the name query on the ApexPage object.

All Answers

sharathchandra thukkanisharathchandra thukkani
what do you mean by vf page id?

You mean the record id ? or the vf page id which starts with '066'?
sri sfdcsri sfdc
Hi Sharath ,

Its Visual force page ID only not record id.
sharathchandra thukkanisharathchandra thukkani
You need to use Apexpages.currentpage().getUrl() in the controller to get the name of the VF page and using the name query on the ApexPage object.
This was selected as the best answer