You cannot change the standard SFDC provided functionality and also it is not possible to prevent the standard functionality execution.Ĭreating multiple threads is also not possible as we can do it in other languages.Īpex code typically contains many things that we might be familiar with from other programming languages. It cannot show the elements in User Interface. Following are a few features which Apex does not support − Since Apex is the proprietary language of, it does not support some features which a general programming language does. The end-user observes no differences in execution time as compared to the standard application platform request. When an end-user triggers the execution of Apex, by clicking a button or accessing a Visualforce page, the platform application server retrieves the compiled instructions from the metadata and sends them through the runtime interpreter before returning the result. When a developer writes and saves Apex code to the platform, the platform application server first compiles the code into a set of instructions that can be understood by the Apex runtime interpreter, and then saves those instructions as metadata. There are two sequence of actions when the developer saves the code and when an end user performs some action which invokes the Apex code as shown below − Developer Action Perform some logic when a record is modified or modify the related object's record when there is some event which has caused the trigger to fire.Īs shown in the diagram below (Reference: Salesforce Developer Documentation), Apex runs entirely on demand Platform Flow of Actions Perform complex validation over multiple objects at the same time and also custom validation implementation.Ĭreate complex business processes that are not supported by existing workflow functionality or flows.Ĭreate custom transactional logic (logic that occurs over the entire transaction, not just with a single record or object) like using the Database methods for updating the records. Apex ApplicationsĬreate Web services with integrating other systems.Ĭreate email services for email blast or email setup. Below are the cases where we need to use apex over Salesforce configuration. When Should Developer Choose Apex?Īpex should be used when we are not able to implement the complex business functionality using the pre-built and existing out of the box functionalities. Easy TestingĪpex provides built-in support for unit test creation and execution, including test results that indicate how much code is covered, and which parts of your code can be more efficient. Upgrades AutomaticallyĪpex is upgraded as part of Salesforce releases.
Any code that violates limits fails with easy-to-understand error messages. Consequently, the Apex runtime engine is designed to guard closely against runaway code, preventing it from monopolizing shared resources. Multitenant EnvironmentĪpex runs in a multitenant environment. It uses direct reference to schema objects like sObject and any invalid reference quickly fails if it is deleted or if is of wrong data type. Strongly TypedĪpex is a strongly typed language. It issues multiple transaction statements on Database. Strongly Integrated With DataĪpex is data focused and designed to execute multiple queries and DML statements together.
For example, variable declaration, loop syntax and conditional statements. Java like syntax and easy to useĪpex is easy to use as it uses the syntax like Java. We will study the sObject, SOQL, SOSL in detail in future chapters. It has support for inline SOQL and SOSL query handling which returns the set of sObject records. Let us now discuss the features of Apex as a Language − IntegratedĪpex has built in support for DML operations like INSERT, UPDATE, DELETE and also DML Exception handling. Apex is included in Performance Edition, Unlimited Edition, Enterprise Edition, and Developer Edition.
It enables the developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pages.Apex code can be initiated by Web service requests and from triggers on objects. It has a Java-like syntax and acts like database stored procedures. As per the official definition, Apex is a strongly typed, object-oriented programming language that allows developers to execute the flow and transaction control statements on the platform server in conjunction with calls to the API. Apex is a proprietary language developed by the.