Activity Forums Salesforce® Discussions How to use HasRecordid in Lightning Component in Salesforce?

  • Marziya

    Member
    February 10, 2020 at 4:45 PM

    Hii Deepak,

    Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned the ID of the current record.

    force:hasRecordId in Custom Lightning Component development

  • [adinserter block='9']
  • Shubham

    Member
    February 10, 2020 at 5:06 PM

    Hi Deepak,

    The force:hasRecordId interface does two things to a component that implements it.

    It adds an attribute named recordId to your component. This attribute is of type String, and its value is an 18-character Salesforce record ID,

    When your component is invoked in a record context in Lightning Experience or the Salesforce app, the recordId is set to the ID of the record being viewed

Log In to reply.