Salesforce Question Answers Part-||
Q15. Difference between Normal Apex and Batch Apex?
|NORMAL APEX||BATCH APEX|
|Normal Apex having 100 records in one cycle for the execution of SQL queries.||Batch Apex do the same execution in 200 records per cycle.|
|In Normal apex 50,000 SQL queries are retrieved.||In this 50 million queries can be retrieved.|
|Heap size of normal apex is 6mb||It has 12 mb of heap size.|
So normal apex is most preferable to use as compare to batch apex because it has less mb heap size.
Q16. What is Process builder in Salesforce?
Process builder helps to automate business processes like record update, email tasks etc. Process uses custom or standard objects with related actions to automate a business processes and it does it all without a single line of code.
Process builder in Salesforce include-:
– Creating records
– Updating records
– Posting a chatter
– Launching/triggering the flow
– Submitting the record automatically for approval.
– Quick Action
– Calling/triggering Apex code
– Invoking another process
Q17. What is SFDC? Why you use SFDC?
SFDC stands for Salesforce.com. It is started as Software as a service (SaaS). Saleforce provides different software solutions as well as platform for users and developers to develop and distribute custom software. It is based on multitenant architecture. Common technology is shared by different customers and run on latest release. The application or infrastructure updation happen automatically, which helps the organization to focus on innovation instead of managing technology.
SFDC is used because-:
- Availability on cloud, there is no need to install the software and hardware.
- Due to the use of force.com (SaaS platform) it reduces the development cost.
- It is very good opportunity or market place to sell or buy customer’s application from AppExchange.
- In this CRM is more demandable.
Q18. What is Self-Relationship? What cause the data loss in Salesforce?
It is relationship lookup to same object. It allows users to take the object and along this creating relationship with other objects.
Data loss is caused by-:
- Data loss is happen due to changing of text-area to the e-mail, phone, URL etc.
- Auto-number changing except from text.
- Date and date-time change.
- Migration to percent, currency as well as number from other data types.
- Alteration of multi-select picklist, checkbox, autonumber to other types.
- Changing from any type to multi-select picklist except picklist.
Q19. What is trigger in Salesforce? Also explain Trigger.new?
It is a code which is executed before as well as after insertion and updation of record.
Trigger.new is a command. It returns record list which is added recently to sObject’s. For more precise results returned records yet to be saved to database. This sObject list available only in insertion and updation triggers, but the records can only be modified before triggers.
Moreover Trigger.old returns the list of old version records of sObject and this sObject list is available in update and deletes triggers.
Q20. What are various types of Reports available in Salesforce?
There are 4 types of reports are available in Salesforce:
- Tabular report
- Matrix report
- Summary report
- Joined Report
In this tabular form is used. As the result of grand total is displayed in the format of table.
It is in-depth report in which both row-based and column-based grouping is included.
In this grouping of report is done on the column basis.
It is about joining two or more reports into one report.
Q21. Define SOSL, SOQL and DML in salesforce?
It is denoted as Salesforce object search language. It is similar with SOQL. It returns list of the objects as it works on different objects or multiple objects. In this retrieving of records are done by using FIND keyword.
It is defined as Salesforce object query language. It is used to query data from the objects. It is similar with SQL. In this tables are defined as objects and Columns are taken as object fields. Retrieving of records is done by using SELECT keyword.
It is data manipulation language. By using DML records are managed in salesforce. Keywords used in this are UPDATE, DELETE, INSERT AND UPSERT by adding MERGE, UNDELETE.
Q22. What are governor limits?
These are run-time limits and these are enforced at the runtime of Apex. In Apex runtime engine multitenant environment strictly enforces number of limits to ensure that code should not be monopolize shared resources.
There are following types of limits-:
- Database resources
- Number of records being processed
- Number of Script statements to avoid infinite loops.
Apex limits are-:
- Records to be retrieved by SOQL queries- 50000
- Records to be retrieved by Database.getQueryLocator- 10,000
- Total no. Of SOSL queries issued- 20
- No. Of records retrieved from single SOSL query- 2,000
- Total no. Of DML statements issued- 2150
- Records processed as a result of DML statements, Process, Approval, emptyRecyclebin, ordatabase- 10,000
Q23. What are class constructors? Which fields are automatically indexed in Salesforce?
Class constructors are very special methods which are used to create objects out of class definition. Constructors don’t have explicit type of return. Name of constructors are same with classes. Constructors are default, it has no arguments and there are no explicit constructors. Overloading is also there in constructor, which means you have several constructors that have unique parameters, with different kinds of signatures and argument list. Constructors are called before the all other methods inside the class.
In Salesforce fields automatically indexed are-:
- Primary Keys (Id, Name and Owner fields).
- Foreign Keys
- Audit dates
- Custom Fields marked as External ID or a unique field.
Q24. What is difference between insert () and database .insert ()? Explain Audit trail?
Using insert method you can insert the records but insertion fail occurs if there is any error in record system and no record will be inserted.
But if you want to insert partially of the bulk insert operation then you will use database .insert.
Audit trail is a function, it helps to track the all changes performed by different administrators to the organization in last 6 months duration.
Detail which is covered is-:
- Date on which changes made
- Username that made changes
- Details of the changes made.
Q25. When should Apex is used? How Apex work?
Apex is used for-:
- Apex is used to create email services.
- Web services are created using Apex.
- Apex can performed complex validations over the multiple objects.
- It is used for complex business processes which are not supported by workflow.
- With Apex custom transaction logic is created.
- In Apex custom logic is attached to another operation.
Apex is worked as-:
- Apex programs run entirely ON-Demand on platform (Force.com).
- In Apex first the compilation of code is done by platform application server into set of instructions which can be understood by Apex runtime interpreter.
- Then the compiled code will be stored to metadata.
- When end user triggers for the execution of Apex then the server retrieves the compiled instruction and send to runtime interpreter.
- Definition of Remote method in your Apex controller class.
- Method definition is written in apex, but differences from normal action methods.
Q27. What is an External ID in SalesForce? Which all field data types can be used as External Ids?
It is custom field which is used as unique identifier in record. External ID’s are used for importing records/data. While records are importing one record among many fields in those records needs to be marked as a unique identifier (External ID).
For External ID only custom fields can be used. And the fields that can be marked are-: Texts, Numbers, Email and Auto-Number.