• #37996
    Salesforce | Aman Aman #4
    Forcetalks

    What is the use of force:hasRecordId interface in Salesforce?

    What is the use of force:hasRecordId interface in Salesforce?

     

    #37997
    Salesforce | shariq shariq #1
    Forcetalks

    Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned the ID of the current record.
    The recordId attribute is set only when you place or invoke the component in a context of a record. For example, when you place the component on a record page, or invoke it as an action from a record page or object home. In all other cases, such as when you create this component programmatically inside another component, recordId isn’t set, and your component shouldn’t depend on it

    #38052
    Salesforce | Parul Parul #2
    Forcetalks

    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, for example: 001xx000003DGSWAA4. If you added it yourself, the attribute definition would look like the following markup: <aura:attribute name=”recordId” type=”String” />

    #39151
    Forcetalks

    Hello

    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, for example: 001xx000003DGSWAA4. If you added it yourself, the attribute definition would look like the following markup: <aura:attribute name=”recordId” type=”String” />

    Note: If your component implements force:hasRecordId, you don’t need to add a recordId attribute to the component yourself. If you do add it, don’t change the access level or type of the attribute or the component will cause a runtime error.

    Thanks.

Viewing 4 posts - 1 through 4 (of 4 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?