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
learnSFlearnSF 

How to retrive page reference id from url in ajax toolkit in javascript?

Hi,

 

I want to retrive Id from page url in javascript instead of apex class.

 

I know we can do it in apex like  

System.currentPagereference().getParameters().get('id');

 

How we can achive in ajax toolkit javascript?

 

Thanks

 
Anand SinghAnand Singh

If the URL is "/servlet/servlet.Integration?lid=09N5000000056uu&id=005500000005Uiu" ,

the following merge field will read the parameter "id" from the URL:

var temp ="{!$Request.Id}";

 

 

Hope this resolves your query!!