Activity Forums Salesforce® Discussions Why is ApexPages.currentPage().getParameters().get retruning a null value in Salesforce?

  • Why is ApexPages.currentPage().getParameters().get retruning a null value in Salesforce?

    Posted by krati vishnoi on January 24, 2020 at 12:10 PM

    I am trying to get the value of ApexPages.currentPage().getParameters().get(‘RecordId’). But it is returning me a null value. What am I missing?

    Deepak replied 6 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • Deepak

    Member
    January 24, 2020 at 1:19 PM

    Hi Krati,

    You are trying to get the value of ApexPages.currentPage().getParameters().get(‘RecordId’). But it is returning a null value because there might not be any existing record of that particular record id or may be missing some URL parameters.

    Hope it helps!

Log In to reply.