Skip to main content

Know about APEX

Apex is a proprietary language  that sits within Force.com platform and it can only be invoked within triggers and classes(write triggers and classes).(Which means its not a general purpose language which can be used out side Force.com)

Apex is complied and executed in cloud so does not need any dedicated Hardware or Software and it runs on Salesforce.com Servers.

Apex is not technically auto-upgraded with each new application release because it is saved with a specific version of the API. However, like other Force.com features, Apex automatically works with the new version of Salesforce application.

With Apex, we can only create specific functionalities such as triggers on objects and new Salesforce Web Services. We CANNOT create entirely new application written only in Apex out of Force.com.
This is the one of the difference between Tradition code and Apex code.
Traditional code allows users to create all type of applications like small, stand alone to complex and web based application.

Apex  is object oriented programming language that supports inheritance and polymorphism and runs in a multitenant environment and is Case - INSENSITIVE.

Apex has 2 main components:- Classes & Triggers.
i)Trigger is a Apex method/procedure which will be automatically executed during a DML operations like -Insert/Update/Delete operations of a particular object.
ii)Class is a library of attributes and methods.very much similar to Java or C# classes.

Apex is also used to write Visualforce controllers(similar to Classes). which provide data and actions to Visualforce pages when the pages controlled by this data and action are rendered.

Apex is also used to write Web Services using Web Services API and key word [webservices].This means that Apex is also available via AJAX toolkit

Code Compilation
In the Force.com environment, when a user saves Apex code its sent to Apex Server. at Apex server the code is complied and checked for syntax errors. Only when no errors are found the code is saved to the Force.com DataBase. else an errors are thrown back to user and code will not be saved.
But users use Force.com IDE(Intergrated Development Environment)  - Ecplise. The code gets save to local hard drive(Local system) irrespective of any errors.



Comments

Popular posts from this blog

SFDC scenario based interview Questions

1) Consider this scenario I  have a profile  by name 'ProvideReadAccess' and two users U1 and U2 assigned to it. And I have object X. My Question is I want to have ReadWrite access for U1 and ReadOnly access for U2  for the object X. How do I do this? Answer: Read Access for both users is common hence in the Profile settings give 'Read' access for the object 'X' By doing this User U2 will be able to read all the records( One condition satisfied) but U1 will also be able to only read the records(Second condition not satisfied). So next what do we do is we create a permission set say 'GrantWriteAccess' and in this permission set we give the object 'X' the Write access and assign the user U1 to this permission set.(2nd condition satisfied). Explanation about when and where to use permission set and profile https://success.salesforce.com/answers?id=90630000000grVPAAY 2) Consider a scenario I have not given any CRUD...
Interview Question on Triggers 1) What the are events of triggers? - After insert,After Update & After Delete 2) Upsert trigger can call which all events? -After Update & After Insert 3) What is merge operation? 4) Which events will be called during merger operation? - Ans Delete n Update 5) In After Undelete, we cannot see trigger.old, only trigger.new can be seen.True or False?        -TRUE 6) Static variable declarion in trigger is possible,True or false?      -TRUE but it will not work. 7) In After update trigger event to Save a record do we need DML statement? - Yes 8) In before insert trigger event can we have trigger.new and trigger.newmap? - we can only have trigger.new, Trigger.newmap is not possible because still the record is not inserted             and record Id is not generated. 9) Can we have batch/asynchronous method called from a Trigger? - YES 10) Can we ...

Custom Labels

Can we have multiple values in Custom Labels. Yes, Salesforce supports multiple values in custom Labels. How to implement that ? Create a New custom label and provide Multiple values with comma ( , ) separated. Example:   Custom Label Name: School Values: Test,Exam,Tutions How to access this Custom Label in Apex controller / Class file Syntax: System.Lable.CustomLabelName Example:System.Label.School How to access this Custom Label in Visualforce page Syntax: !$Label.CustomLabelName Example: !$Label.School How do we check if TempString is present in the custom label in a controller ? Syntax: System.Label.CustomLabelName.Contains(value) Example: System.Label.School.contains(TempString) How do we check if TempString is present in the custom label in a visualforcepage? Syntax: CONTAINS($Label.CustomLabelName,TextValue) Example: CONTAINS($Label.School,"Text")