You need to sign in to do that
Don't have an account?
Nikvm257
get object id programatically
Hello Gurus
Please let me know if it is possible to get the object Id of say Account object using some prome / code line in vforce
What i m talking about
if below is the link
https://cs4.salesforce.com/001300000099rPu
for Account XYZ then how can I get 001300000099rPu this Id in vforce
like
fu( Account1 ) = ID
Thanks in advance!
To get the ID of the current record in a VF page, you can do two things:
1. Get page parameter
ID accID;
accID = ApexPages.CurrentPage().getparameters().get('id');
2. Get current record
Account acct;
acct = (Account)controller.getRecord();
then use acct.ID
All Answers
In visualforce page you can get the URL as {!$CurrentPage.URL} (not sure abt exact syntax still)
I think one way is to get it in a javascript function split it with '/' and get the last part which is the id value
or on a second thought if you can get sure that id is 15 character value you can use {!RIGHT($CurrentPage.URL,15)}
that might work but not exactly tested.
hope that helps.....let us know the result.
To get the ID of the current record in a VF page, you can do two things:
1. Get page parameter
ID accID;
accID = ApexPages.CurrentPage().getparameters().get('id');
2. Get current record
Account acct;
acct = (Account)controller.getRecord();
then use acct.ID
Thanks @starz, @sam
Thank you very much fore reviewing the post.
Your responses were very helpful.
I will work over them and try to post the reult here
Thanks again !