Activity Forums Salesforce® Discussions What is the difference between bound variable and global variable in Salesforce Apex?

  • Parul

    Member
    September 17, 2018 at 11:37 am

    Hi Anurag,

    There is no term 'Bound Variable' in salesforce, rather it is BIND variable.

    The BIND variable is the variable name TIED with the controller.

    Using the standard controller (<apex:page standardController="Contact">) and referencing it as {! Contact.FirstName } would be accepted as solution.

    Use global variables to reference general information about the current user and your organization on a page.
    Global variables must be referenced using Visualforce expression syntax to be evaluated.

    For example:  {!$User.FirstName}.

    Hope this helps.

    Thanks

  • shariq

    Member
    September 18, 2018 at 1:48 am

    Hi,

    Global - This means that the method or variable is visible to any inner classes in the defining Apex class, and to the classes that extend the defining Apex class. You can only use this access modifier for instance methods and member variables.

    Bind - This use of a local code variablewithin a SOQL or SOSL statement is called a bind .

    Hope it helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos