
Hi Guys,Welcome back, Today we discuss about Sample Gallery and how can we use sample gallery apps into our salesforce orgs.
It is automated process that fired an action based on evolution criteria and rule criteria and Path : Setup Create Workflow & Approval process.
It is a piece of code that executes before and after a record is inserted or updated. we can use 20 DML operations in one trigger.
It is a class whose instance are collections of other objects. It is used to display different object on visualforce pages in same table.
Static resources is used to upload images, zip files, jar files, JavaScript, CSS and it is referred to visual force pages.
Output Text always display field value as text irresponsive of data types such as currency, lookup ..etc and Output Field is display automatically according to fields data types, if it currency looks currency symbol, if it is lookup type then display as link in pages.
Always display field value as text box irrespective of data types. Display automatically according to fields data types.
Data table is used to display records without out standard Salesforce look and feel and Pageblocktable is used to display records with standard Salesforce look and feel.
No , we cant change class and trigger in production. We can change visualforce pages in production but page does not have custom controller.
Sales Cloud refers to the sales module in Salesforce.com. It includes Leads, Accounts, Contacts, Contracts, Opportunities, Products, Price books, Quotes, and Campaigns.
Service Cloud refers to the service module in Salesforce.com. It includes Accounts, Contacts, Cases, and Solutions.
No, We cannot.
Page Layout is used for web application and Compact Layout is used for Mobile applications.
Role hierarchy, OWD (Organization Wide Default), Manual Sharing, Criteria based sharing rules and apex sharing.
IsNull is support only numbers. IsBlank is support both text and number.
Trigger.New returns a list of new version of sObjects records. This Sobjects is only available insert & update and records only modified in before triggers.
Trigger.NewMap is map of new ID versions and Trigger.OldMap is map of old ID versions.
To test write class functionality is working or not by using test class. Salesforce does not allow deployment in production if test coverage is less than 75.
By using Future Annotation, we can find methods are running asynchronously.
By using addError().
Start , Execute and Finish methods.
Yes, we can lock records in apex using for update.
Visualforce Component is a piece of code that can be reused and encapsulated in other vf pages.
By Making Field as required on visualforce page marking as required is equal to true.
User can change his role but he cannot change his profile.
Yes we can convert visualforce into excel format by using content type.
Text, HTML (Using letterhead ),Custom (Using without Letter head) and Visualforce Page.
Rollup Summary is used to display the count of child records and calculate the sum, minimum and maximum of child records.
Audit Trail provides the information or track all the recent setup changes that an administrator done to organization. It stores the last 6 months data.
It defines the basic level of access to data records for all users in organization. It helps to restrict access into data. They are Private, Public Read/write, Public Read/write/Transfer, Controlled by Parent, Public read only.
Folders are used to store organization email templates, documents, reports and dashboards.
Apex can be invoked by using triggers . Apex triggers enable you to perform custom actions before or after changes to Salesforce records, such as insertions, updates, or deletions. A trigger is Apex code that executes before or after the following types of operations: insert.
Apex is a proprietary programming language provided by the Force.com platform to developers similar to Java and C#. It is a strongly typed, object-oriented, case-insensitive programming language, following a dot-notation and curly-brackets syntax.
Workflow is automated process that fired an action based on Evaluation criteria and rule criteria
We can access a workflow across the object. Trigger is a piece of code that executes before or after a record is inserted or updated. We can use 20 DML operations in one trigger.
There are two types of triggers: Before triggers are used to update or validate record values before they’re saved to the database.
JavaScript remoting is a tool that front-end developers can use to make an AJAX request from a Visualforce page directly to an Apex controller. JavaScript remoting allows you to run asynchronous actions by decoupling the page from the controller and to perform tasks on the page without having to reload the entire page
Basically the apex:param tag is used to pass values from the Visualforce Page to the Apex Controller.
A wrapper or container class is a class, data structure, or an abstract data type whose instances are a collections of other objects. It is a custom object defined by Salesforce developer where he defines the properties of the wrapper class.
Transient keyword in Apex classes that are serializable, namely in controllers, controller extensions, or classes that implement the Batchable or Schedulable interface. … Declaring variables as transient reduces view state size.
Trigger is piece of code that is executes before and after a record is Inserted/Updated/Deleted from the force.com database.
1.Before Triggers-These triggers are fired before the data is saved into the database.2.After Triggers-These triggers are fired after the data is saved into the database.
Trigger.isInsert: Returns true if the trigger was fired due to insert operation.Trigger.isUpdate: Returns true if the trigger was fired due to update operation.
Trigger.isDelete: Returns true if the trigger was fired due to delete operation.
Trigger.isBefore: Returns true if the trigger was fired before record is saved.
Trigger.isAfter: Returns true if the trigger was fired after record is saved.
Trigger.New: Returns a list of new version of sObject records.
Trigger.Old: Returns a list of old version of sObject records.
Trigger.NewMap: Returns a map of new version of sObject records. (map is stored in the form of map)
Trigger.OldMap: Returns a map of old version of sObject records. (map is stored in the form of map)
Trigger.Size: Returns a integer (total number of records invoked due to trigger invocation for the both old and new)
Trigger.isExecuting: Returns true if the current apex code is a trigger.
Trigger.New is Returns a list of new version of sObject records butTrigger.NewMap is Returns a map of new version of sObject records.
Trigger.New is Returns a list of new version of sObject records andTrigger.Old is Returns a list of old version of sObject records.
yes we can. It is same as usual class method calling from trigger. The only difference being the method should always be asynchronous with @future
Recursion occurs in trigger if your trigger has a same DML statement and the same dml condition is used in trigger firing condition on the same object(on which trigger has been written).
By default every trigger is a bulk trigger which is used to process the multiple records at a time as a batch. For each batch of 200 records.
Using @Future annotation we can convert the Trigger into a Asynchronous Class and we can use a Callout method.
1. Executes all before triggers.
2. Validation rules.
3. Executes all after triggers.
4. Executes assignment rules.
5. Executes auto-response rules.
6. Executes workflow rules.
7. If there are workflow field updates, updates the record again.
8. If the record was updated with workflow field updates, fires before and after triggers one more time. Custom validation rules are not run again.
9. Executes escalation rules.
10. If the record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Parent record goes through save procedure.
11. If the parent record is updated, and a grand-parent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the parent record. Grand-parent record goes through save procedure.
12. Executes Criteria Based Sharing evaluation.
13. Commits all DML operations to the database.
14. Executes post-commit logic. Ex: Sending email.
Use a static variable in an Apex class to avoid an infinite loop. Static variables are local to the context of a Web request.
We can write more than one trigger But it is not recommended .Best practice is One trigger On One object.
Total number of records retrieved by SOQL queries-50,000.
Each execution of a batch Apex job is considered a discrete transaction. For example, a batch Apex job that contains 1,000 records and is executed without the optional scope parameter from Database.executeBatch is considered five transactions of 200 records each. The Apex governor limits are reset for each transaction. If the first transaction succeeds but the second fails, the database updates made in the first transaction are not rolled back.
By using Batch apex classes we can process the records in batches in asynchronously.
The class that implements this interface can be executed as a batch Apex job.
Start:
global Database.Querylocator start (Database.BatchableContext bc){}
Execute:
global void execute(Database.BatchableContext bc,List){}
Finish:
global void finish(Database.BatchableContext bc) {}
It collect the records or objects to be passed to the interface method execute.
If we use a Database.QueryLocator,the governor limit for the total number of records retrieved by SOQL queries is bypassed. (Default 50,000 It allow up to 50 million records).
If you use an iterable,the governor limit for the total number of records retrieved by SOQL queries is still enforced.
Contains or calls the main execution logic for the batch job.
Execute method is called for each batch of records.
The maximum value for the optional scope parameter is 2,000
Yes we can call.
Yes you can call a batch apex from another batch apex .Either in start method or in finish method you can call other batch.
Batch executions are limited to one callout per execution.
Asynchronous operations.
The default batch size is 200 records.
BatchableContext Interface is Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex.
You can check the AsyncApexJob.Status using the JobId from the Database.BatchableContext.
Queued counts toward the limit of 5.
To maintain variable value inside the Batch class, Database.Stateful is used.
To use a callout in batch Apex, you must specify Database.AllowsCallouts in the class definition. For example:
global class SearchAndReplace implements Database.Batchable
AsyncApexJob is Represents an individual Apex sharing recalculation job.Use this object to query Apex batch jobs in your organization.
For each 10,000 AsyncApexJob records, Apex creates one additional AsyncApexJob record of type BatchApexWorker for internal use.