+ Start a Discussion
alchemyalchemy 

fetching entityid

   what are the ways of fetching entity id of a page and then using to retrieve the values

 

Best Answer chosen by Admin (Salesforce Developers) 
Shashikant SharmaShashikant Sharma

 

Did not understand your question , If you are asking how to retieve an object rcord id from url from query parameter
if(ApexPages.currentPage().getParameters().get('recordId') != null)
  {
         String recordId = Apexpages.currentPage().getParameters().get('recordId');
         
  }

 

All Answers

Shashikant SharmaShashikant Sharma

 

Did not understand your question , If you are asking how to retieve an object rcord id from url from query parameter
if(ApexPages.currentPage().getParameters().get('recordId') != null)
  {
         String recordId = Apexpages.currentPage().getParameters().get('recordId');
         
  }

 

This was selected as the best answer
alchemyalchemy

 

  when i am trying to execute the query that you have posted i am getting the error as attempt to dereference a null object.

  Y is it happening so....