Activity Forums Salesforce® Discussions What is the differentiate between Local id and Global id in Salesforce Lightning?

  • Ratnesh

    Member
    January 31, 2020 at 2:17 pm

    A local ID is an ID that is only scoped to the component. A local ID is often unique but it’s not required to be unique.

    Every component has a unique globalId, which is the generated runtime-unique ID of the component instance. A global ID (1) is not guaranteed to be the same beyond the lifetime of a component, so it should never be relied on. A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes.

  • Marziya

    Member
    January 31, 2020 at 5:57 pm

    Hello Kirandeep,

    You can retrieve a component using its local ID in your JavaScript code. A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes. A local ID is an ID that is only scoped to the component. A local ID is often unique but it's not required to be unique.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos