
Hi Guys,Welcome back, Today we discuss about Sample Gallery and how can we use sample gallery apps into our salesforce orgs.
component that adds AJAX support to another component, allowing the component to be refreshed asynchronously by the server when a particular event occurs, such as a button click or mouse over.
Action Region provides an area of a Visualforce page that decides and separates which components should be processed by the force.com server when an AJAX request is generated. … We will still use rerender attribute on action component to decide area which should be rerendered AJAX request completes.
View state data in encrypted and cannot be viewed tools like firebug. To maintain state in a Visualforce page, the Force.com platform includes the state of components, field values, and controller state in a hidden form element. This encrypted string is referred to as the view state and has a limit of 135KB.
Remote action function in Salesforce allows user to access any method from any class through JavaScript methods, and get the result as a JavaScript object for further manipulation. Points to remember while implementing remote action function: Remote action method should have @RemoteAction annotation.
Action poller acts as a timer in visualforce page. It is used to send an AJAX request to the server depending on the time interval (time interval has to be specified or else it defaults to 60 seconds). In the action attribute a controller method gets called .
There are times where there are more than 1000 records in the collection to be rendered. When this occurs, the Visualforce collection limit of 1000 is hit and the page doesn’t load.
The Future Annotation is used to execute a method asynchronously in Salesforce. For example, we can use the future method to make a Web Service callout from an Apex Trigger. Methods with the future annotation must be static and can only return void data type. .
The PageReference is one of the most commonly used classes in Visualforce programming. In general, an instance of the PageReference class can be used to refer to another web page.
created, and every time its edited.
You don't have to query in apex (fire select query) to retrieve the data stored in custom settings.
Standard controller inherits all the standard object properties, standard button functionalities can be directly used. Custom controller defines custom functionalities, a standard controller can be extended to develop custom functionalities using keyword “extensions.
Yes we can have more than extensions.
The one which is present in the controller defined on the left side will be called.
Governor limits are the limits imposed by Salesforce so as to avoid monopoly by orgs in using Salesforce shared resources.
use standardset controllers for implementing pagination.
Visualforce page should be a list controller that is it should have “recordsetVar” attribute defined in page tag.
Change sets, eclipse and ANT .
No. This is default and cannot be changed .
Use action function component to call controller method from java script.
Use pagereference object for calling a visualforce page from controller method.
Use order by clause in select query for sorting a list of records.
No. Set only stores unique values. List can have duplicate values in it.
Yes.
This can be done using reRender attribute.
Use Userinfo.getuserid() to get the current logged in user’s id in apex.
Use csvfilecontents.tostring(). method to convert blob to string.
Using database.query Example: List accList = Database.query(‘select name from account’); .
This field is used for custom grouping of values in a field. This can be used in summarizing the report.
Dashboards which run for logged in user are dynamic dashboards.
No they cannot be scheduled.
Use this syntax for accessing custom label in visualforce page – {!$Label.Samplelabel}.
List type and Hierarchy type.
There are three types of collections in apex language. They are Set, List and Map.
Map has keys and values. A key points to a single value. Map can be used to store relationship between two entities. Keys in map are unique. Values can be duplicated.
They are One to many, Many to many and Master detail.
No. These are present only in case of master details relationship.
Action functions can call controller method from java script, action support adds support to other components.
Action poller sends AJAX request with a specified time interval.
They are tabular report, Summary Report, Matrix Report and Joined Report.
You can have only one active assignment rule at a time.
Use this syntax for accessing static resource {!$Resource.Testresourcename}.
You can enable inline editing in visualforce page by using component.
Trigger.New is a list of records that are in the context of trigger or becuase of these records(modification,Creation, deletion) the trigger has been called.
Bulkfication requires iterating over all the records in trigger context\nfor example : for(account ac: trigger.new)\n{\n// your logic here\n}.
use trigger.old map for getting previous values of fields.
Trigger.New is a read only list, but field values can be changed in case of before trigger.
it means the list you are trying to access has no values in it.
Clear unused collections, define variable as transient.
It is the exact copy of your production org.
select query that can return records of multiple objects as list of lists.
it stands for asynchronous java and XML.
This can be done using addError() method in trigger.
Future method starts execution when Salesforce has resources available. That is for asynchronous execution.
test class always begins with @isTest.
Use toString to convert blob into string.
Start method, execute method and finish method.
When you use ‘with sharing’, user’s permissions and field-level security are respected. In case of ‘without sharing’ code runs in system mode.
To use dml in visualforce component you have to declare allowdml=true in visualforce component otherwise you will get an exception “DML is currently not allowed.
Earlier this was not allowed but now SOSL are allowed in triggers.
Private, Public, Protected and Global are the four access modifiers allowed in apex.
Yes provided you have ticked marked “Allow reparenting” in field setting otherwise the field is read only and master cannot be changed.
Use For update in query to lock the record. For example: [select id,name from contact limit 20 For update]; .
It is a piece of code that can be reused. It can be encapsulated in other visualforce pages.
To display AJAX request status we can use component.
: Yes, string custLabelstr = System.Label.LabelNamehere.
Use method keyset() for this Set idSet = mapname.keyset();.
For comparing picklist value use ispickval ISPICKVAL(picklist_field, text_to_compare) .
Developer, Developer Pro, Partial Data and Full are the types of sandboxes in Salesforce.
mark required = true.
This can be done by associating a controller class with that standard controller using “Extensions.
use ApexPages.CurrentPage().getparameters().get(‘id’) to get the current record id in visaulforce page. .
No, a user cannot change change his own profile.
Yes this can be done !! .
If in the profile setting “login ip ranges” have been set up then the option of “reset security token” is unavailable.
Record name field can have either of the two data types : Auto Number or Text data type.
No apex trigger /class cannot be edited in production.
Yes this can be done but cannot be associated with any controller.
use contentType=”application/vnd.ms-excel#Contacts.xls” in page component of visualforce page.
It is a list of records in current context in a trigger.
To create a input date field on vf page you will have to bind it with a existing date field on any object.
stringname.toUppercase();.
string.valueof(integerName); .
Test, HTML (using Letterhead), Custom (without using Letterhead) and Visualforce.
This can be done using record types.
No this cannot be done.
They are Checkbox, currency, Date, Date/Time, Number, Percent and Text.
No, you have to clone from a existing profile and modify the settings as required.
Custom labels are custom text values that can be accessed from apex codes and visualforce pages.
No, sharing rule can only give wider access to data it cannot restrict data access.
No, roll up summary fields are read only and cannot be edited.
Relationship can be set up by crating either look up relationship field or master detail relationship fields on objects.
Roll up summary fields can only be created if the relationship between objects is master detail type.
This can be done using include attribute.
use emptyrecyclebin method as below
delete myAccList;
DataBase.emptyRecycleBin(myAccList);
.
A set can store all primitive data types and sObjects but not collections.
Using offset keyword return the records starting from desired location in the list. For example if we specify offset then all the records starting from location onwards would be returned.
This can be done using IMAGE function. A url of the image stored in document should be given in image function.
In set up we can enable or disable whether triggers should run on conversion.
When an account is deleted all the contacts under it gets deleted.
sObject refers to any object that can be stored i force.com platform database. ex. sObject s = new contact().
There is no limit on the number of elements that can be stored in a collection. However, we need to consider the heap size limit.
SOQL- Salesforce object query language, SOSL – Salesforce object search language.
SOQL can query records from a single object at a time, while SOSL can query records from multiple objects. SOQL returns a list while SOSL returns list of lists.
This can be done using ALL ROWS keyword. This queries all records including deleted records in recycle bin .
Using @future annotation with a method executes it whenever Salesforce has resources available.
Methods, variables when defined as static are initialized only once when class is loaded. Static variables are not transmitted as part of view state for a visualforce page.
Custom setting data is not available default in a test class. We have to set seeAllData parameter true while defining a test class as below. @isTest(seeAlldata=true) .
Role defines record level access while profile defines object level access.
Queues can be created on two standard objects (Lead and case) and also on all custom objects.
Apex code can be invoked using DML operation(trigger), Apex class can be scheduled using schedulable interface(ex. batch apex), apex code can be run through developer console, an apex class can be associated with a visualforce page.
No. Detail objects cannot have sharing rules as the detail objects do not have owner field with them.
Use transient keyword with variables wherever possible, clear unused collections. Use form tag in a visualforce page.
The time based workflow action is removed from the queue and will not get fired.
Sharing rules extend the record/data access level which is set using OWD, role hierarchy. Sharing rule cannot restrict the data visibility but can only widen it.
An external id can be of type text, number or email type.
Mini page layout defines fields and related list to be displayed in hover detail and console tab. Whenever you hover mouse over any recently viewed record the fields are displayed, related list is not displayed(fields can be set in mini page layout).Console tab fields and related list on the right hand side are also controlled by mini page layout.
Console gives list views and related list records for multiple objects on a single screen without any customization (visualforce page or controller) .
It is used to indicate that code should be executed asynchronously when Salesforce has available resources.
Method must be static, It must return void and method can have argument of type primitives, collection of primitives or arrays of primitives.
List type stores static data that can be used in apex code as it is examples could be country codes, currencies etc. Hierarchy type stores data that may change depending on user, profile or org wide default.
Custom setting data can be accessed in formula fields, validation rules, workflow rules, apex, API.
A SOQL can return List of objects, a single object or an integer.
Apex exceptions can be built in or we can also create our own custom exceptions. Exception class is the super class of all the built in exceptions. So as to create a custom exception the class name should end with string ‘exception’ and it should extend any of the built in exception class or other custom exception class.
Governors limit are run time limits that are enforced by Salesforce. Governors limits are reset per transaction.
An apex transaction represents set of operations that are executed as a single synchronous unit.
Every apex transaction has its heap. Heap is nothing but the garbage collected at the end of every apex transaction.
An apex class can be exposed as REST web service by using keyword ‘@RestResource’.
Custom controller is an apex class that implements all of the logic for a vf page without leveraging standard controller.
No. A custom controller cannot accept any arguments and must use a no argument constructor for outer class.
getter methods, setter methods and action methods.
Getter methods retrieve data from controller while setter methods pass data from page to controller.
Organization wide default is used to set default access level for various standard objects and all custom objects. Default access can be set as Public read only, Public read write, Public read write and transfer for different objects.
No, Detail object will always have default access as ‘Controlled by Parent’ and it cannot be changed.
No, this cannot be done.
No, you cannot have standard object as detail object in case of master detail relationship.
Set stores only unique elements while list can store duplicates elements. Elements stored in list are ordered while those stored in set are unordered.
Outbound messaging is part of the workflow rule functionality in Salesforce. Workflow rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such as sending email alerts, creating task records, or sending an outbound message.
List Custom Settings: A type of custom setting that provides a reusable set of static data that can be accessed across your organization. Hierarchy Custom Settings: A type of custom setting that uses a built-in hierarchical logic that lets you personalize settings for specific profiles or users.
record types is to create a different page layout for different records within the same object. Each record type has their own values available for a picklist on the object, this is really where the different business process comes into play and is really useful.
We can use System.Label.labelName to access custom label in apex code. Custom labels are custom text values that can be accessed from Apex classes or Visualforce pages. The values can be translated into any language Salesforce supports.
A flow interview is a running instance of a flow. A flow is an application built by your administrator that asks you for inputs and does something in Salesforce based on those inputs.
Master Detail relationship is the Parent child relationship. In which Master represents Parent and detail represents Child. If Parent is deleted then Child also gets deleted. Rollup summary fields can only be created on Master records which will calculate the SUM, AVG, MIN of the Child records. Look up relationship is something like as-a (Containership) relationship. Where one record has reference to other records. When one record is deleted then there is no impact on other records.
Accounts are companies which your doing business.
Personal Accounts are solo person or an individual customer doing business and Business Account is company or an organization.
They are Field update, Email alert, Send Outbound messages, Create new task.
Whoid is the id of either contact or Lead. Whatid is the id of the related to record in activity record(standard or custom object) .
force.com is PAAS(platform as a service) and Salesforce.com is SAAS(software as a service) .
It is a field which can be used to store a value that is used as a reference for that record in other system. For example if you have a record in system ‘xyz’ where it is referenced by some value then that value can be used as external id in Salesforce for that record.External id can be used for upsert operation in data loader.
When lead is converted a contact, account and optionally an opportunity is created.
This can be done by creating junction object between the two objects.
detail record gets deleted.
Child record remains undeleted.
The detail record is not seen. But a page, wherein it shows the links for formed account, contact and opportunity.
Private, Public Read only, Public read write, Public read write transfer, controlled by parent, Public full access.
Yes, this is possible, Role is not mandatory for user.
No, a user should always have a profile. Profile is mandatory unlike role.
Profile contains set of permissions and access settings that controls what user can do within the organization.
A set of permissions is given to the users without changing the profile.
OWD’S are base line record level security for objects in the organization. It is used to restrict access to data
A role controls the level of visibility that users have to an organization’s data
The people who have authenticated username and password to login to the Salesforce successfully.
These are used to override the OWD permissions. Sharing rules are two types, They are Based on record owner and Based on criteria.
Role Hierarchy states that higher hierarchy person can see lower hierarchy person records.
No. Permission Sets are used only to extend the Profile permissions. It never overrides.
Create a Permission Set with read/write and assign it to User .
All users can just Read the record. Create a Sharing Rule to give Read/Write access with “Based on criteria” Sharing Rules.
Role Hierarchy states that higher hierarchy person can see lower hierarchy person records. Sharing Rule is used to extend Role Hierarchy.
No, once we create an user in Salesforce we cannot delete the user record. We can only deactivate the user record.
Using Profiles and Permission Sets .
Permission set.
In OWD we have Private but your higher position persons should see that time we go for Grant Access Using Hierarchies.
Not possible.
Manual sharing is to share a record to a particular user manually. Go to detail page of record and click on manual sharing button and assign that record to other user with Read or Read/Write access. Manual Sharing button enables only when OWD is private to that object.
Using record types we can assign different page layouts to different users based on their profiles and To enable different sets of standard/custom picklist values to different users.
through import wizard we can import up to 50,000 records if we want to insert more than 50,000 records then we use data loader. through data loader we can import upto 1 million records. using import wizard we do only insert, upsert but using data loader we do insert, update, upsert, export, export all ,delete.