function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pkulkarnipkulkarni 

RE: Apex Help

Hello,

 

     I am beginner in Apex. So, Can any one give me brief information of Apex? like its purpose, advantages over other languages etc... 

 

Thanks....!!!

Best Answer chosen by Admin (Salesforce Developers) 
subbu123.pbt@gmail.comsubbu123.pbt@gmail.com

Apex:

Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Force.com platform server in conjunction with calls to the Force.com API. Using syntax that looks like Java and acts like database stored procedures, Apex enables developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pagesApex code can be initiated by Web service requests and from triggers on objects.
Apex can be stored on the platform in two different forms:
  • A class is a template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables, exception types, and static initialization code under Your Name | Setup | Develop | Apex Classes.
  • A trigger is Apex code that executes before or after specific data manipulation language (DML) events occur, such as before object records are inserted into the database, or after records have been deleted. Triggers are stored as metadata in Salesforce. A list of all triggers in your organization is located at Your Name | Setup | Develop | Apex Triggers. 
Apex generally runs in system context; that is, the current user's permissions, field-level security, and sharing rules are n’t taken into account during code execution.
You must have at least 75% of your Apex covered by unit tests before you can deploy your code to production environments. In addition, all triggers must have some test coverage. 
After creating your classes and triggers, as well as your tests, replay the execution using the Developer Console
Defining Apex Classes:

Apex classes are stored as metadata in Salesforce.
 
To create a class:
  1. Click Your Name | Setup | Develop | Apex Classes.
  2. Click New.
  3. Click Version Settings to specify the version of Apex and the API used with this class. If your organization has installed managed packages from the AppExchange, you can also specify which version of each managed package to use with this class. Use the default values for all versions. This associates the class with the most recent version of Apex and the API, as well as each managed packageYou can specify an older version of a managed package if you want to access components or functionality that differs from the most recent package version. You can specify an older version of Apex and the API to maintain specific behavior.
  4. In the class editor, enter the Apex code for the class. A single class can be up to 1 million characters in length, not including comments, test methods, or classes defined using @isTest.
  5. Click Save to save your changes and return to the class detail screen, or click Quick Save to save your changes and continue editing your class. Your Apex class must compile correctly before you can save your class.
Once saved, classes can be invoked through class methods or variables by other Apex code, such as a trigger.
 
Note:  Is it use full to u please click on star button .

All Answers

subbu123.pbt@gmail.comsubbu123.pbt@gmail.com

Apex:

Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Force.com platform server in conjunction with calls to the Force.com API. Using syntax that looks like Java and acts like database stored procedures, Apex enables developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pagesApex code can be initiated by Web service requests and from triggers on objects.
Apex can be stored on the platform in two different forms:
  • A class is a template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables, exception types, and static initialization code under Your Name | Setup | Develop | Apex Classes.
  • A trigger is Apex code that executes before or after specific data manipulation language (DML) events occur, such as before object records are inserted into the database, or after records have been deleted. Triggers are stored as metadata in Salesforce. A list of all triggers in your organization is located at Your Name | Setup | Develop | Apex Triggers. 
Apex generally runs in system context; that is, the current user's permissions, field-level security, and sharing rules are n’t taken into account during code execution.
You must have at least 75% of your Apex covered by unit tests before you can deploy your code to production environments. In addition, all triggers must have some test coverage. 
After creating your classes and triggers, as well as your tests, replay the execution using the Developer Console
Defining Apex Classes:

Apex classes are stored as metadata in Salesforce.
 
To create a class:
  1. Click Your Name | Setup | Develop | Apex Classes.
  2. Click New.
  3. Click Version Settings to specify the version of Apex and the API used with this class. If your organization has installed managed packages from the AppExchange, you can also specify which version of each managed package to use with this class. Use the default values for all versions. This associates the class with the most recent version of Apex and the API, as well as each managed packageYou can specify an older version of a managed package if you want to access components or functionality that differs from the most recent package version. You can specify an older version of Apex and the API to maintain specific behavior.
  4. In the class editor, enter the Apex code for the class. A single class can be up to 1 million characters in length, not including comments, test methods, or classes defined using @isTest.
  5. Click Save to save your changes and return to the class detail screen, or click Quick Save to save your changes and continue editing your class. Your Apex class must compile correctly before you can save your class.
Once saved, classes can be invoked through class methods or variables by other Apex code, such as a trigger.
 
Note:  Is it use full to u please click on star button .
This was selected as the best answer
souvik9086souvik9086

You can refer this

 

http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

http://www.salesforce.com/us/developer/docs/apexcode/

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

pkulkarnipkulkarni
Hello,

Thank you for sharing your knowledge and finding time for me. Thanks a lot.


Regards.