Guide Questions and Answers33
Users of your Visualforce page are complaining that their page is loading slowly. What are some
things you can do to remedy the problem? - ANSWERS -Reduce your view state size
Cache any data that is frequently accessed
Avoid SOQL queries in your Apex controller getter methods
Reduce the number of records displayed on a page
Lazy Load Apex objects to reduce request times
Consider moving any JavaScript outside of the <apex:includeScript> tag and placing it into a
<script> tag right before your closing <apex:page> tag
Action methods used by <apex:actionPoller> should be lightweight
Increase the time interval for calling Apex from your Visualforce page
Move non-essential logic to an asynchronous code block using Ajax
By using the with sharing keyword when creating your Apex controllers, you have the possibility
of improving your SOQL queries by only viewing a data set for a single user
,Check out this reference:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/
pages_best_practices_performance.htm
What are some methods to decrease heap size? - ANSWERS -Limits.getHeapSize()
Limits.getLimitHeapSize()
Check out this reference: https://help.salesforce.com/articleView?id=000170956&type=1
Choose the correct definition for <apex:pageMessage>
A: Standard Salesforce formatting, throws a specific message on a page
B: Standard Salesforce formatting, shows *all* errors that occur on page. Can add more
messages through the "ApexPages.addMessage" function
C: A single message, without formatting, that can be associated with a specific component on
the page
D: No formatting; displays all errors on a page - ANSWERS -A: Standard Salesforce formatting,
throws a specific message on a page
<apex:pageMessages>
A: Standard Salesforce formatting, throws a specific message on a page
,B: Standard Salesforce formatting, shows *all* errors that occur on page. Can add more
messages through the "ApexPages.addMessage" function
C: A single message, without formatting, that can be associated with a specific component on
the page
D: No formatting; displays all errors on a page - ANSWERS -B: Standard Salesforce formatting,
shows *all* errors that occur on page. Can add more messages through the
"ApexPages.addMessage" function
Choose the correct definition for <apex:message>
A: Standard Salesforce formatting, throws a specific message on a page
B: Standard Salesforce formatting, shows *all* errors that occur on page. Can add more
messages through the "ApexPages.addMessage" function
C: A single message, without formatting, that can be associated with a specific component on
the page
D: No formatting; displays all errors on a page - ANSWERS -C: A single message, without
formatting, that can be associated with a specific component on the page
Choose the correct definition for <apex:messages>
A: Standard Salesforce formatting, throws a specific message on a page
B: Standard Salesforce formatting, shows *all* errors that occur on page. Can add more
messages through the "ApexPages.addMessage" function
, C: A single message, without formatting, that can be associated with a specific component on
the page
D: No formatting; displays all errors on a page - ANSWERS -D: No formatting; displays all errors
on a page
Choose the correct definition for <apex:actionFunction>
A: Allows for controller methods to be called directly from Javascript. Must be encapsulated in
<apex:form> tags. Unlike actionSupport, these function<apex:actionPoller>s can be called
directly from Javascript code
B: Sends an AJAX request according to the time interval you specify. If this ever gets re-
rendered, it resets
C: Adds AJAX support to another component (e.g. onClick, onMouseUp, onFocus, etc.)
D: Can be associated with an AJAX request (actionFunction/actionSupport/actionPoller) and
shows content conditionally depending on the status of the request (in progress/complete). Use
the "id" field to specify name; use "status" field on related components to connect them
E: Signifies which components should be processed by the server when an AJAX request is
generated - ANSWERS -A: Allows for controller methods to be called directly from Javascript.
Must be encapsulated in <apex:form> tags. Unlike actionSupport, these functions can be called
directly from Javascript code
Choose the correct definition for <apex:actionPoller>