Your SlideShare is downloading. ×
0
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
My cool new Slideshow!
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

My cool new Slideshow!

687

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
687
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
41
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Apex Language Construct Study Guide Presenting By: Abhijita Panigrahy Trainer Ceptes Software Pvt. Ltd. Email: [email_address]
  • 2. Content <ul><li>What is Apex </li></ul><ul><li>Language Construct </li></ul><ul><li>Testing Apex </li></ul>
  • 3. What is Apex <ul><li>Force.com Apex code is a strongly-typed, object-oriented programming language that allows developers to execute flow and </li></ul><ul><li>transaction control statements on the Force.com platform server in conjunction with calls to the Force.com API. </li></ul><ul><li>All Apex runs entirely on-demand on the Force.com platform, as shown in the following architecture diagram: </li></ul>
  • 4. Supports <ul><li>Data manipulation language (DML) </li></ul><ul><li>Inline Salesforce.com Object Query Language (SOQL) and Salesforce.com Object Search Language (SOSL) queries that return lists of sObject records </li></ul><ul><li>Looping </li></ul><ul><li>Locking syntax </li></ul><ul><li>Custom public Force.com API calls etc. </li></ul>
  • 5. When Should I Use Apex <ul><li>Create Web services </li></ul><ul><li>Create email services </li></ul><ul><li>Perform complex validation over multiple objects </li></ul><ul><li>Create complex business processes that are not supported by workflow </li></ul><ul><li>Create custom transactional </li></ul><ul><li>Attach custom logic to another operation, such as saving a record </li></ul>
  • 6. Limitations of Apex <ul><li>Render elements in the user interface other than error messages </li></ul><ul><li>Change standard functionality—Apex can only prevent the functionality from happening, or add additional functionality </li></ul><ul><li>Create temporary files </li></ul><ul><li>Spawn threads </li></ul>Apex cannot be used to:
  • 7. Understanding Apex Core Concepts A typical Apex script contains many things that you might be familiar with from other programming languages:
  • 8. Writing Your First Apex Script To create a apex class click Setup ➤ Develop ➤ Apex Classes, click New
  • 9. Testing Apex Script Testing and unit tests are an important part of the development. You must have at least 75% of your Apex scripts covered by unit tests to deploy your scripts to production environments. In addition, all triggers should have some test coverage. Salesforce.com recommends that you have 100% of your scripts covered by unit tests, where possible. Calls to System.debug are not counted as part of Apex code coverage in unit tests. @isTest private class TestClassName{ static testMethod void methodName() {} }
  • 10. Language Constructs <ul><li>Data Types </li></ul><ul><li>Variables </li></ul><ul><li>Expressions </li></ul><ul><li>Assignment Statements </li></ul><ul><li>Conditional Statements </li></ul><ul><li>Loops </li></ul><ul><li>Exception Statements </li></ul>
  • 11. Data Types <ul><li>Decimal </li></ul><ul><li>Double </li></ul><ul><li>ID </li></ul><ul><li>Integer </li></ul><ul><li>Long </li></ul><ul><li>String </li></ul><ul><li>Time </li></ul><ul><li>sObject Types (eg: Account a = new Account(); </li></ul><ul><li> MyCustomObject__c co = new MyCustomObject__c();) </li></ul>
  • 12. Collections <ul><li>Lists </li></ul><ul><li>Maps </li></ul><ul><li>Sets </li></ul>
  • 13. List The following are ways to declare and populate a set:
  • 14. Set & Map The following are ways to declare and populate a set or a map:
  • 15. Variables <ul><li>Case Sensitivity </li></ul><ul><li>Constants </li></ul><ul><li>eg : static final IntegerPRIVATE_INT_CONST; </li></ul><ul><li> static final IntegerPRIVATE_INT_CONST2 = 200; </li></ul>
  • 16. Loops <ul><li>Do-While Loops </li></ul><ul><li>While Loops </li></ul><ul><li>For Loops </li></ul><ul><li>Traditional For Loops </li></ul>
  • 17. Exception Statements <ul><li>Throw Statements </li></ul><ul><li>Try-Catch-Finally Statements </li></ul><ul><li>throw statements can be used to generate exceptions, while </li></ul><ul><li>try, catch, and finally can be used to gracefully recover from </li></ul><ul><li>an exception. </li></ul>

×