Activity Forums Salesforce® Discussions What is the use of access=“global” in Salesforce?

  • shariq

    Member
    September 24, 2018 at 3:26 am

    The framework enables you to control access to your applications, attributes, components, events, interfaces, and methods via the access system attribute. The access system attribute indicates whether the resource can be used outside of its own namespace.
    You can specify these values for the access system attribute.

    Private: Available within the component, app, interface, event, or method and can’t be referenced outside the resource. This value can only be used for or .Marking an attribute as private makes it easier to refactor the attribute in the future as the attribute can only be used within the resource.
    Accessing a private attribute returns undefined unless you reference it from the component in which it’s declared. You can’t access a private attribute from a sub-component that extends the component containing the private attribute.

    Public: Available within your org only. This is the default access value.

    Global: Available in all orgs.

  • Avnish Yadav

    Member
    September 26, 2018 at 1:12 pm

    Hello,

    access=" global" - This means the method or variable can be used by any Apex code that has access to the class, not just the Apex code in the same application. This access modifier should be used for any method that needs to be referenced outside of the application, either in the SOAP API or by other Apex code. If you declare a method or variable as global, you must also declare the class that contains it as global.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos