Salesforce Certified Application Architect

Sunday, 29 December 2013

Visualforce Limits &Value

Maximum response size for a Visualforce page Less than 15 MB
Maximum view state size in a Visualforce page 135KB
Maximum size of a Visualforce email template 1 MB
Maximum file size for a file uploaded using a Visualforce page 10 MB
Maximum size of HTML response before rendering, when Visualforce page is rendered Less than 15 MB
as PDF
Maximum PDF file size for a Visualforce page rendered as a PDF 60 MB
Maximum total size of all images included in a Visualforce page rendered as a PDF 30 MB
38
Force.com Platform Limits Visualforce LimitsLimit Value
Maximum response size of a JavaScript remote call 15 MB
Default timeout for a JavaScript remoting call 30000 milliseconds (30 seconds)
Maximum timeout for a JavaScript remoting call 120000 milliseconds (120 seconds)
Maximum number of rows retrieved by queries for a single Visualforce page request 50,000
Maximum number of rows retrieved by queries for a single Visualforce page request in 1 million
read-only mode
Maximum number of collection items that can be iterated in an iteration component 1,000
such as <apex:pageBlockTable> and <apex:repeat>
Maximum number of collection items that can be iterated in an iteration component 10,000
such as <apex:pageBlockTable> and <apex:repeat> in read-only mode
Maximum number of field sets that can be displayed on a single Visualforce page. 50
Maximum number of records that can be handled by StandardSetController 10,000

You will want to learn the usage for these common $Actions that you may need to execute from a custom Visualforce page CommandButton or CommandLink, but that are not included in the common set of directly bindable actions:

Share:
<apex:commandButton value=”Share” action=”{!URLFOR($Action.Account.
Share, Account.id)}”/>

Clone:
<apex:commandButton value=”Clone” action=”{!URLFOR($Action.Account.
Clone, Account.id)}”/>

New:
<apex:commandButton value=”New” action=”{!URLFOR($Action.Account.
New)}”/>

Tab:
<apex:commandButton value=”Tab” action=”{!URLFOR($Action.Account.Tab,
$ObjectType.Account)}”/>

URLFOR() Directing to a Visualforce page:

In addition to invoking actions, you can also use the URLFOR() function for simple navigation
to redirect a user to any web page, including any Visualforce page, by specifying the target as the
name of your page prepended with apex/ to create the partial URL.

For example, to redirect to our Visualforce page named CustomAccountPage we would use the
following syntax:

<apex:outputLink value=”{!URLFOR(‘apex/CustomAccountPage’)}” >
 Goto My Custom Account Page
</apex:outputLink>

In addition, you can also construct links referencing any Frontdoor URL pattern to directly launch
an insert, edit or view action on any sObject by simple URL navigation.

<apex:outputLink value=”{!URLFOR(‘/’+Contact.accountId)}” >
 View My Parent Account
</apex:outputLink> 

Stateful Action Mechanisms:

The Visualforce stateful action components are most typically bound to a common set of standard
controller actions available for all sObjects associated with any standard controller as referenced
on the page.

The most commonly used action components include:
apex:commandButton which renders a button that calls an action.
apex:commandLink which renders a link that calls an action.
apex:page can call an action upon load with its action attribute.

Additional components are available specifically designed for AJAX processing:
apex:actionPoller which calls an action on a timer.
apex:actionSupport which binds to a JavaScript ‘on’ event on a referenced component
to call an action.
apex:actionFunction that generates code for a JavaScript function to call an action.

The following are the common actions which can be invoked in the context of the sObject
associated with the referenced standard controller:
List: navigates the user to the default list view.
View: navigates to the default detail page.

Cancel: aborts an edit operation, and returns the user to the page where the user originally
invoked an edit or insert.
Save: inserts a new record or updates an existing record in context, and then returns the user
to the default detail page for the saved record.
QuickSave: inserts a new record or updates an existing record in context, but unlike the save
it does not redirect the user to another page but leaves the user on the page where the action
was initiated from.
Edit: navigates to the edit page for the record in context, and then whether saved or
cancelled, returns the user to the page where the action was originally invoked.
Delete: deletes the record in context, and then navigates the user to the Home Tab of the
associated sObject.

Here is an example of the direct binding syntax for each with an apex:commandButton component:
 <apex:commandButton action=”{!list}” value=”List” />
 <apex:commandButton action=”{!view}” value=”View” />
 <apex:commandButton action=”{!cancel}” value=”Cancel” />
 <apex:commandButton action=”{!save}” value=”Save” />
 <apex:commandButton action=”{!quickSave}” value=”Quick Save” />
 <apex:commandButton action=”{!edit}” value=”Edit” />
 <apex:commandButton action=”{!delete}” value=”Delete” />

What is Contained in the View State?

The data in the view state should be sufficient to recreate the state of the page when the postback
is received. To do this, it stores the following data:

• All non-transient data members in the associated controller (either standard or custom)
and the controller extensions.
• Objects that are reachable from a non-transient data member in a controller or controller
extension.
• The component tree for that page, which represents the page’s component structure and
the associated state, which are the values applied to those components.
• A small amount of data for Visualforce to do housekeeping.
View state data is encrypted and cannot be viewed with tools like Firebug. The view state
inspector described below lets you look at the contents of view state.

About Controllers and Extensions:

A standard controller:  consists of the same functionality and logic that is used for a standard
Salesforce page. For example, if you use the standard Accounts controller, clicking a Save button
in a Visualforce page results in the same behavior as clicking Save on a standard Account edit
page. If you use a standard controller on a page and the user doesn’t have access to the object, the
page will display an insufficient privileges error message. You can avoid this by checking the user’s
accessibility for an object and displaying components appropriately.

A standard list controller enables you to create Visualforce pages that can display or act on a set
of records. Examples of existing Salesforce pages that work with sets of records include list pages,
related lists, and mass action pages.

A custom controller is a class written in Apex that implements all of a page’s logic, without
leveraging a standard controller. If you use a custom controller, you can define new navigation
elements or behaviors, but you must also reimplement any functionality that was already provided
in a standard controller. Like other Apex classes, custom controllers execute entirely in system
mode, in which the object and field-level permissions of the current user are ignored. You can
specify whether a user can execute methods in a custom controller based on the user’s profile.

A controller extension is a class written in Apex that adds to or overrides behavior in a standard
or custom controller. Extensions allow you to leverage the functionality of another controller while
adding your own custom logic.

Time, Date, and Datetime Format...

There are three data types associated with dates and times. The Time data type stores times (hours, minutes, second and
milliseconds). The Date data type stores dates (year, month and day). The Datetime data type stores both dates and times.
Each of these classes has a newInstance method with which you can construct particular date and time values. For example,
execute the following:

Date myDate = Date.newinstance(1960, 2, 17);
Time myTime = Time.newInstance(18, 30, 2, 20);
System.debug(myDate);
System.debug(myTime);

This outputs:
1960-02-17 00:00:00
18:30:02.020Z

The Date data type does hold a time, even though it's set to 0 by default.
You can also create dates and times from the current clock:

Datetime myDateTime = Datetime.now();
Date today = Date.today();

The date and time classes also have instance methods for converting from one format to another. For example:
Time t = DateTime.now().time();
Finally, you can also manipulate and interrogate the values by using a range of instance methods. For example, Datetime
has the addHours, addMinutes, dayOfYear, timeGMT methods and many others. Execute the following:
Date myToday = Date.today();
Date myNext30 = myToday.addDays(30);
System.debug('myToday = ' + myToday);
System.debug('myNext30= ' + myNext30);
You'll get something like this as the output.
2012-02-09 00:00:00
2011-03-10 00:00:00

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...