Thursday 3 January 2019

SFDC Interview Questions:


Links
https://www.shellblack.com/administration/owds/
https://www.simplilearn.com/top-salesforce-interview-questions-and-answers-article
sfdcfaq.blogspot.com/2013/04/what-is-case.html
https://www.forcetalks.com/salesforce-topic/how-to-display-names-of-contact-amp-opportunity-related-to-an-account-in-a-visualforce-page/
https://www.salesforcetutorial.com/how-to-use-system-runas/


Use the with sharing keywords when declaring a class to enforce the sharing rules that apply to the current user.

Use the without sharing keywords when declaring a class to ensure that the sharing rules for the current user are not enforced

Sales Cloud vs Service Cloud

Difference between Sales Cloud and Service Cloud :

Sales Cloud Implements Sales and Marketing for business development while Service cloud implements Salesforce Knowledge.
Sales Cloud is a great solution for small and mid-sized sales groups that want to rapidly increase revenue and cost effectively deploy Salesforce While Service Cloud provides Customer Support to the Clients and giving you the platform to provide a better customer experience for your clients.
Sales Cloud gives you the ability to open Cases and relate them to Accounts, Contacts; etc.
While The Service Cloud is a super set of Sales Cloud, meaning you get everything that is in Sales Cloud PLUS some other features.
When we develop product in force.com for sales then it comes in Sales Cloud Ex: – Account, Contacts, and Lead.
While when we want to provide some facility and also provides support to the clients then it comes in Service Cloud. Ex: – create cases is the example of Service Cloud in which client write his problem into cases instead of call.

what is the difference between profiles and roles?
https://www.shellblack.com/administration/owds/
Profile - to restrict object level
Role - i to open up the user level access
what are web services? why we need to go for them?

REST Service - @RestResource(urlMapping='/Account/*')
Annotation Action Details
@HttpGet Read Reads or retrieves records.
@HttpPost Create Creates records.
@HttpDelete Delete Deletes records.
@HttpPut Upsert Typically used to update existing records or create records.
@HttpPatch Update Typically used to update fields in existing records.

SOAP Service
WSDL file

What is WSDL?

Enterprise WSDL
1. The Enterprise WSDL is strongly typed.
2. The Enterprise WSDL is tied (bound) to a specific configuration of Salesforce (ie. a specific organization's Salesforce configuration).
3. The Enterprise WSDL changes if modifications (e.g custom fields or custom objects) are made to an organization's Salesforce configuration.

For the reasons outlined above, the Enterprise WSDL is intended primarily for Customers.

Partner WSDL
1. The Partner WSDL is loosely typed.
2. The Partner WSDL can be used to reflect against/interrogate any configuration of Salesforce (ie. any organization's Salesforce configuration).
3. The Partner WSDL is static, and hence does not change if modifications are made to an organization's Salesforce configuration.

For the reasons outlined above, the Partner WSDL is intended primarily for Partners.

Download a WSDL file when logged into Salesforce

1. Click Setup | Develop | API
2. Click the link to download the appropriate WSDL.
3. Save the file locally, giving the file a ".wsdl" extension.
What is SOAP?
SOAP is defined as an XML-based protocol.
It is known for designing and developing web services as well as enabling communication between applications developed on different platforms using various programming languages over the Internet.
It is both platform and language independent.


How you will make a class available to others for extension? (Inheritance concept)
The class has to be either abstract or virtual in order to extend it.
A class that extends another class inherits all the methods and properties of the extended class.
In addition, the extending class can override the existing virtual methods by using the override keyword in the method definition.
Overriding a virtual method allows you to provide a different implementation for an existing method.
This means that the behavior of a particular method is different based on the object you’re calling it on. This is referred to as polymorphism.
A class extends another class using the extends keyword in the class definition. A class can only extend one other class, but it can implement more than one interface.
This example shows how the YellowMarker class extends the Marker class. To run the inheritance examples in this section, first create the Marker class.
public virtual class Marker {
public virtual void write() {
System.debug('Writing some text.');
}

public virtual Double discount() {
return .05;
}
}
// Extension for the Marker class
public class YellowMarker extends Marker {
public override void write() {
System.debug('Writing some text using the yellow marker.');
}


In the process of creating a new record, how you will check, whether user has entered email or not in the email field of Account object?
Validation Rule (ISBLANK(Email__c)) or Trigger with before event.
trigger CheckName on Account (before insert)
{
List<account> a1=[Select id from account where account.name=:trigger.new[0].name];
if(a1.size()>0)
{
trigger.new[0].name.addError('Account Name already Exist');
}

}

How you will write a javascript function that display an alert on the screen?
<apex:page>
       <apex:form>
         <apex:selectList value="{!selectedItem}" onchange="callMethod()">
           <apex:selectOption value="{!itemList}"
         </apex:selectList>
       <apex:actionfunction name="callMethod" action="{!controllerMethod}" oncomplete="showAlert({!returnValue })"/>
      <apex:form>
  <script>
function showAlert(t) {
  if(t) {
alert('Correct');
  } else {
alert('No value entered !');
  }
}
  </script>
</apex:page>

Whatis the value of “renderas” attribute to display o/p in the form of Excel Sheet?
<apex:page contentType="application/vnd.ms-excel#report.xls" >

How you will get the javascript function into Visualforce page?
1. You can then use the functions defined within that JavaScript file within your page using <script> tags.
When using JavaScript within an expression, you need to escape quotes using a backslash (\). For example,
onclick="{!IF(false, 'javascript_call(\"js_string_parameter\")', 'else case')}"

2. The best method for including JavaScript in a Visualforce page is placing the JavaScript in a static resource, then calling it from there. For example,
<apex:includeScript value="{!$Resource.MyJavascriptFile}"/>

Can we create a dashboard using Visual-force page? and what all the components we use here?
Visualforce pages can be used as dashboard components. A dashboard shows data from source reports as visual components, which can be charts, gauges, tables, metrics, or Visualforce pages.
The components provide a snapshot of key metrics and performance indicators for your organization. Each dashboard can have up to 20 components.
Visualforce pages that use the Standard Controller can’t be used in dashboards.
To be included in a dashboard, a Visualforce page must have either no controller, use a custom controller, or reference a page bound to the StandardSetController Class.
If a Visualforce page does not meet these requirements, it does not appear as an option in the dashboard component Visualforce Page drop-down list.
<apex:page standardController="Case" recordSetvar="cases">
    <apex:pageBlock>
        <apex:form id="theForm">
            <apex:panelGrid columns="2">
                <apex:outputLabel value="View:"/>
<apex:selectList value="{!filterId}" size="1">
<apex:actionSupport event="onchange" rerender="list"/>
<apex:selectOptions value="{!listviewoptions}"/>
</apex:selectList>
</apex:panelGrid>
<apex:pageBlockSection>
<apex:dataList var="c" value="{!cases}" id="list">
{!c.subject}
</apex:dataList>
</apex:pageBlockSection>
</apex:form>
</apex:pageBlock>
</apex:page>

What are web tabs?
Custom Web tabs display any external Web-based application or Web page in a Salesforce tab. You can design Web tabs to include the sidebar or span across the entire page without the sidebar.
Custom tabs display custom object data or other web content embedded in the application.

How you will add an attachment from VF page? tell me the component names to achieve this functionality?
This example illustrates the way to upload a file and attach it against any record using Visualforce. The file that you upload using this will be available in the "Notes & Attachments" related list for the record.

Click here if you are looking to upload a file into "Documents".

Step 1: Create an Apex class named "attachmentsample" . Paste the code below.


public class attachmentsample {

public attachmentsample(ApexPages.StandardController controller) {

}
Public Attachment myfile;
Public Attachment getmyfile()
{
myfile = new Attachment();
return myfile;
}
 
Public Pagereference Savedoc()
{
String accid = System.currentPagereference().getParameters().get('id');

Attachment a = new Attachment(parentId = accid, name=myfile.name, body = myfile.body);

/* insert the attachment */
insert a;
return NULL;


}

Step 2:

Create a Visualforce page named "attachment" and paste the code below.


<apex:page standardController="Account" extensions="attachmentsample">

<apex:form >
  <apex:sectionHeader title="Upload a Attachment into Salesforce"/>
  <apex:pageblock >
  <apex:pageblocksection columns="1">
  <apex:inputfile value="{!myfile.body}" filename="{!myfile.Name}" />
  <apex:commandbutton value="Save" action="{!Savedoc}"/>
  </apex:pageblocksection>
  </apex:pageblock> 
</apex:form>

</apex:page>

Quick Test:
If you do not wish to do Step3 and 4 do this. Paste the following URL in your browser
http://yoursalesforceinstance.com/apex/attachment?id=0017000000eiDgy

ID should be a Valid Account Id of your instance.

Step 3:
Create a custom button (Detail Page button) on Account and select the new Visualforce page that you created as the source.

Step4:
Add the button created in Step3 to the Account Page layout.

You can test this by navigating to any account and clicking on the button that you created in Step3.
You may test

What is Dynamic Approval process?
https://www.salesforcetutorial.com/dynamic-approval-process-salesforce/

Flow of execution in validations, triggers & workflows?
1. The original record is loaded from the database (or initialized for an insert statement)
2. The new record field values are loaded from the request and overwrite the old values
3. All before triggers execute
4. System validation occurs, such as verifying that all required fields have a non-null value, and running any user-defined validation rules
5. The record is saved to the database, but not yet committed
6. All after triggers execute
7. Assignment rules execute
8. Auto-response rules execute
9. Workflow rules execute
10. If there are workflow field updates, the record is updated again
11. If the record was updated with workflow field updates, before and after triggers fire one more time (and only one more time)
12. Escalation rules execute
13. All DML operations are committed to the database
14. Post-commit logic executes, such as sending email

Difference between Trigger.new & Trigger.old?
Trigger.new : Returns a list of the new versions of the sObject records. Note that this sObject list is only available in insert and update triggers, and the records can only be modified in before triggers.
Trigger.old : Returns a list of the old versions of the sObject records. Note that this sObject list is only available in update and delete triggers.

Trigger events? & context variables?
Variable Usage
isExecuting Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call.
isInsert Returns true if this trigger was fired due to an insert operation, from the Salesforce user interface, Apex, or the API.
isUpdate Returns true if this trigger was fired due to an update operation, from the Salesforce user interface, Apex, or the API.
isDelete Returns true if this trigger was fired due to a delete operation, from the Salesforce user interface, Apex, or the API.
isBefore Returns true if this trigger was fired before any record was saved.
isAfter Returns true if this trigger was fired after all records were saved.
isUndelete Returns true if this trigger was fired after a record is recovered from the Recycle Bin (that is, after an undelete operation from the Salesforce user interface, Apex, or the API.)
new Returns a list of the new versions of the sObject records.
This sObject list is only available in insert, update, and undelete triggers, and the records can only be modified in before triggers.

newMap A map of IDs to the new versions of the sObject records.
This map is only available in before update, after insert, after update, and after undelete triggers.

old Returns a list of the old versions of the sObject records.
This sObject list is only available in update and delete triggers.

oldMap A map of IDs to the old versions of the sObject records.
This map is only available in update and delete triggers.

size The total number of records in a trigger invocation, both old and new.

Batch Apex?
Start
Execute
Finish

Will one workflow effects another workflow?
Yes If one workflow field update one field and there is another workflow which gets trigger (provided that on field update "Re-evaluate Workflow Rules after Field Change" is checked).
Check here for more details :
Field Updates That Re-evaluate Workflow Rules

Syntax for upsert & undelete trigger & Purpose undelete?
trigger AccountTrigger on Account( after insert, after update, before insert, before update)
{

    AccountTriggerHandler handler = new AccountTriggerHandler(Trigger.isExecuting, Trigger.size);
   
    if( Trigger.isInsert )
    {
        if(Trigger.isBefore)
        {
            handler.OnBeforeInsert(trigger.New);
        }
        else
        {
            handler.OnAfterInsert(trigger.New);
        }
    }
    else if ( Trigger.isUpdate )
    {
        if(Trigger.isBefore)
        {
            handler.OnBeforeUpdate(trigger.New ,trigger.Old,Trigger.NewMap,Trigger.OldMap);
        }
        else
        {
            handler.OnAfterUpdate(trigger.New ,trigger.Old,Trigger.NewMap,Trigger.OldMap);
        }
    }
}
public with sharing class AccountTriggerHandler
{
    private boolean m_isExecuting = false;
    private integer BatchSize = 0;
    public static boolean IsFromBachJob ;
    public static boolean isFromUploadAPI=false;
   
    public AccountTriggerHandler(boolean isExecuting, integer size)
    {
        m_isExecuting = isExecuting;
        BatchSize = size;
    }
           

    public void OnBeforeInsert(List<Account> newAccount)
    {
        system.debug('Account Trigger On Before Insert');
    }
    public void OnAfterInsert(List<Account> newAccount)
    {
        system.debug('Account Trigger On After Insert');
    }
    public void OnAfterUpdate( List<Account> newAccount, List<Account> oldAccount, Map<ID, Account> newAccountMap , Map<ID, Account> oldAccountMap )
    {
        system.debug('Account Trigger On After Update ');
        AccountActions.updateContact (newAccount);
    }
    public void OnBeforeUpdate( List<Account> newAccount, List<Account> oldAccount, Map<ID, Account> newAccountMap , Map<ID, Account> oldAccountMap )
    {
        system.debug('Account Trigger On Before Update ');
    }

    @future
    public static void OnAfterUpdateAsync(Set<ID> newAccountIDs)
    {

    }     
    public boolean IsTriggerContext
    {
        get{ return m_isExecuting;}
    }
   
    public boolean IsVisualforcePageContext
    {
        get{ return !IsTriggerContext;}
    }
   
    public boolean IsWebServiceContext
    {
        get{ return !IsTriggerContext;}
    }
   
    public boolean IsExecuteAnonymousContext
    {
        get{ return !IsTriggerContext;}
    }
}
Case management?
If we want to upload data through DataLoader, what the changes to be done?
-------------------------------------------------------------------------------------------------------------------------------------------

We have 3 objects Account, Contact, Opportunity. In a VF page, we need to display the names of contact & Opportunity which are related to Account.
<apex:page controller=”AccountRelatedContactsOpportunities”>
<apex:form>
<apex:pageBlock title=”Contacts List” id=”contacts_list”>
<apex:pageBlockTable value=”{! contacts }” var=”ct”>
<apex:column value=”{! ct.FirstName }”/>
<apex:column value=”{! ct.LastName }”/>
<apex:column value=”{! ct.Title }”/>
<apex:column value=”{! ct.Email }”/>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock title=”Opportunity List” id=”opportunity_list”>
<apex:pageBlockTable value=”{! opportunities }” var=”ot”>
<apex:column value=”{! ot.Name }”/>
<apex:column value=”{! ot.CloseDate }”/>
<apex:column value=”{! ot.StageName }”/>
<apex:column value=”{! ot.Amount }”/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

public class AccountRelatedContactsOpportunities {

public List<Contact> getContacts() {
List<Contact> conresults = [Select Id, FirstName, LastName,Title,Email from Contact where accountid=’0012800000hVdfO’];
return conresults;
}
public List<Opportunity> getOpportunities() {
List<Opportunity> oppresults = [Select Id,CloseDate,Amount,StageName,Name from Opportunity where accountid=’0012800000hVdfO’];
return oppresults;
}

}
One object (s1) & 3 tasks (t1, t2, t3) are there. Each task performing discount related stuff. Write a trigger that should calculate the sum of 3 tasks. And if any task is modified than trigger should fire automatically & perform the same.
Ans: List<Task> listof tasks = [select id, name from Task where whatId=Trigger.new];

How can you convert a lead?
Manual
Trigger
Web Service

What is the custom settings ?
List Custom Settings
A type of custom setting that provides a reusable set of static data that can be accessed across your organization.
If you use a particular set of data frequently within your application, putting that data in a list custom setting streamlines access to it.
Data in list settings does not vary with profile or user, but is available organization-wide. Examples of list data include two-letter state abbreviations, international dialing prefixes, and catalog numbers for products.
Because the data is cached, access is low-cost and efficient: you don't have to use SOQL queries that count against your governor limits.

CSR_Settings__c settings = CSR_Settings__c.getInstance('csr');
String  CSR_USER_ID      = settings.CSR_User_ID__c;
Decimal OPP_MIN_VALUE    = settings.Opp_Minimum_Value__c;

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.
The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or “lowest,” value.
In the hierarchy, settings for an organization are overridden by profile settings, which, in turn, are overridden by user settings.
CustomSettingName__c mc = CustomSettingName__c.getOrgDefaults();

Difference between SOSL and SOQL in Salesforce ?
SOQL
SOQL (Salesforce Object Query Language ) retrieves the records from the database by using “SELECT” keyword.
By Using SOQL we can know in Which objects or fields the data resides
We can retrieve data from single object or from multiple objects that are related to each other.
We can Query on only one table.
Used In: List Views, Reports, Apex
Indexing Happens: Synchronously (Can have Custom Indexes or Standard Indexes)
Search Focus: Accuracy. Gives full set of results that match criteria.
Search Scope : Can search 1 object at a time.
SOSL
SOSL(Salesforce Object Search Language) retrieves the records from the database by using the “FIND” keyword.
By using SOSL, we don’t know in which object or field the data resides.
We can retrieve multiple objects and field values efficiently when the objects may or may not be related to each other.
We can query on multiple tables.
    Used In: (Global, Sidebar, Advanced) Search, Apex
Indexing Happens: Happens Asynchronously. Usually 2-3 min. If over 9000 records loaded at one time, the excess are moved to the bulk index queue. (slower).
Search Focus: Relevance & Speed. Similar to Google Search. Weightage placed on recently viewed records.
Search Scope : Can search multiple objects at a time.

What is Sales cloud & Service cloud?
Sales Cloud:
Sales Cloud is mainly focused towards Sales and Marketing for business development.”Sales Cloud” refers to the Sales module in salesforce.com.
It includes Leads, Accounts, Contacts, Contracts, Opportunities, Products, Price books, Quotes, and Campaigns .
It includes features such as Web-to-lead to support online lead capture, with auto-response rules. It is designed to be for completely setup for the entire sales process.
You can use this to help your company to generate revenue or increase revenue.

Service Cloud:
Service Cloud” refers to the “service” or “customer service” module in salesforce.com.
It includes Accounts, Contacts, Cases, and Solutions.
It also encompasses features such as the Public Knowledge Base, Web-to-case, Call Center, and the Self-Service Portal, as well as customer service automation (e.g. escalation rules, assignment rules).
It is designed to allow you to support past, current, and future clients’ requests for assistance with a product, service, and billing.
You use this to help make people happy.

can a Checkbox as controlling field?
Yes we can make a Checkbox as controlling field.

What is System.RunAs ()?
Generally, all Apex code runs in system mode, where the permissions and record sharing of the current user are not taken into account.
The system method runAs enables you to write test methods that change the user context to an existing user or a new user so that the user’s record sharing is enforced.
The runAs method doesn’t enforce user permissions or field-level permissions, only record sharing.
You can use runAs only in test methods.
The original system context is started again after all runAs test methods complete.
The runAs method ignores user license limits. You can create new users with runAs even if your organization has no additional user licenses.

Explain Test.setPage ()?

Data Migration?
Identify the required fields:

The first step is to list the fields involved in the migration process:

Required fields
Optional fields
System Generated fields
Then identify any additional fields that might be required, like:

Legacy IDs
Business rules
Determine the order of migration

In Salesforce, relationships that exist between objects and dependencies dictate the order of migration. For example, all accounts have owners, and opportunities are associated with an account. In this case, the order would be to

Load users
Load accounts
Load opportunities
Relationships are expressed through related lists and lookups in a Salesforce application while IDs(foreign key) create relationships in a database.

Data Migration Workbook

Create and follow a data migration workbook throughout the scope of migration. This is a consolidated workbook that holds the data mapping for each object involved in the process. A single template with multiple tabs (one each for each mapping object) including a DM checklist and storage requirements. The workbook can be personalized based on your own business requirements.

Pre-data migration considerations:

Create and set up a user with a system administrator profile for data migration.
Complete system configuration.
Set up roles/profiles.
Be sure to store all possible legacy IDs for a record in Salesforce. (This can help with troubleshooting later on.)
Confirm that record types and picklist values are defined.
Set up every single product/currency combination in the pricebooks if it will be used in Salesforce. (This will need to be loaded into the standard pricebook first.)
Proper mapping needs to be defined.
Data load considerations:

Clean and optimize your data before loading. It’s always good practice to standardize, clean, de-dupe and validate source data prior to migration.
Use Bulk API for better throughput, especially when working with large data volumes to increase load speed.
Disable and defer what you can. When you know your data is clean, you can safely disable the processes that you would normally have in place to protect against data entry errors in batch loads, or made by users during daily operations. All of these operations can add substantial time to inserts — complex triggers in particular. These are the first things you should investigate when you debug a slow load.
While loading large data volumes, the calculations can take a considerable amount of time. We can probably increase load performance by deferring the sharing calculations until after the load is complete.
Some additional rules for migration:

Clearly define the scope of the project.
The process builder must be aware of source format and target (Salesforce) required data format.
Your migration process must have the ability to identify failed and successful records. The common approach is to have an extra column in a source table that stores the target table’s unique ID. That way, if there are fewer failure records after the first iteration, you can re-execute the process, which will only pick failed records that are not yet migrated.
Actively refine the scope of the project through targeted profiling and auditing.
Minimize the amount of data to be migrated.
Profile and audit all source data in the scope before writing mapping specifications.
Define a realistic project budget and timeline based on knowledge of data issues.
Aim to volume-test all data in the scope as early as possible at the unit level.
These best practices can help you prepare for and execute a successful large-volume Salesforce data migration.
Roll-up summary?
Master Detail Relationship

What are default methods for Batch Apex?
Ans: start(), execute() and finish()

Mention changing what may cause data loss?
Changing to or from type Date or Date/Time
Changing to Number from any other type
Changing to Percent from any other type
Changing to Currency from any other type
Changing from Checkbox to any other type
Changing from Picklist (Multi-Select) to any other type
Changing to Picklist (Multi-Select) from any other type
Currently defined picklist values are retained when you change a picklist to a multi-select picklist.
If records contain values that are not in the picklist definition, those values are deleted from those records when the data type changes.
Changing from Auto Number to any other type
Changing to Auto Number from any type except Text
Changing from Text to Picklist
Changing from Text Area (Long) to any type except Email, Phone, Text, Text Area, or URL

Mention what is the difference between isNull and isBlank?
isNull: It supports for number field
isBlank: It supports for Text field

Is it possible to schedule a dynamic dashboard in Salesforce?
What does it indicate if an error state this “list has no rows for assignment”?
'List has no rows for assignment to SObject' error. The error "List has no rows for assignment to SObject" occurs when query doesn't return any rows.
While a SELECT normally returns an array/list, these statements are using the shorthand syntax that assumes only one row is returned.

------------------------------------------------------------------------------------------------------------------

5. What are activities
Task
Events

6. What is the difference between Task and Event
An event is a calendar event scheduled for a specific day and time.
Examples of events are:

1)      Meetings
2)      Scheduled Conference Calls

A task is an activity not scheduled for an exact day and time. You can specify a due date for a task or there may not be a particular time or date that the tasks or activities need to be completed by.

Examples of tasks are:

- A list of phone calls you need to make.
-  An email that needs to be sent.

------------------------------------------------------------------------------------------------
1. What are recursive triggers. How can we avoid the recursion problem
Recursion occurs when same code is executed again and again. It can lead to infinite loop and which can result to governor limit sometime.
Sometime it can also result in unexpected output.
public class RecursiveTriggerHandler{
public static Boolean isFirstTime = true;
}
trigger SampleTrigger on Contact (after update){

Set<String> accIdSet = new Set<String>();

if(RecursiveTriggerHandler.isFirstTime){
RecursiveTriggerHandler.isFirstTime = false;

for(Contact conObj : Trigger.New){
if(conObj.name != 'SFDC'){
accIdSet.add(conObj.accountId);
}
}

// Use accIdSet in some way
}
}
Action Function: –
Action Function is used in the Visualforce page to call the Service Side method using JavaScript and does not add the Ajax Request before calling the Controller method.

<apex:actionFunction name=”myactionfun” action=”{!actionFunctionTest}” reRender=”pgBlock, pbSection” />

Let us talk about above example. In any Javascript Method where the name of ActionFunction ( In our example myactionfun() ) will be invoked, it will call the controller method name actionFunctionTest. Example myactionfun();

Action Support: –
As the name indicates action support is used to provide the support to the input field where we can not get event either manually or external event. It adds the AJAX request to VF page and then Calls the Controller method. For

For example, if we want to call any server side method when input changes then we will go for action support because we can not get any event for this.

<apex:inputText value=”{!dummyString}” >
  <apex:actionSupport event=”onchange” action=”{!actionSupportTest}”                                     reRender=”pgBlock, pbSection” />
</apex:inputText>

Action Poller: –
A timer that sends an AJAX request to the server according to a time interval that you specify. Each request can result in a full or partial page update.

<apex:actionPoller action=”{!incrementCounter}” reRender=”counter” interval=”15″ enabled = “true” />

Enabled attribute is used to make poller as active or inactive by default value is true. If we provide false then poller will be inactivate.

-------------------------------------------------------------------------------------------------
1. What is Apex
Ans: It is the in-house technology of salesforce.com which is similar to Java programming with object oriented concepts and to write our own custom logic.

2. What is an S-Control
Ans: S-Controls are the predominant salesforce.com widgets which are completely based on Javascript. These are hosted by salesforce but executed at client side. S-Controls are superseded by Visualforce now.

3. What is a Visualforce Page
Ans: As I said in the above answer, S-controls are superseded by Visulaforce, Visualforce is the new markup language from salesforce, by using which, We can render the standard styles of salesforce. We can still use HTML here in Visualforce. Each visualforce tag always begins with "apex" namespace. All the design part can be acomplished by using Visualforce Markup Language and the business logic can be written in custom controllers associated with the Page.

4. Will Visual force still supports the mege fields usage like S-control.
Ans: Yes. Just like S-Controls, Visualforce Pages support embedded merge fields, like the {!$User.FirstName} used in the example.

5. Where can I write my Visualforce code
Ans: You can write the code basically in 3 ways. One go to, setup->App Setup->Develop->Pages and create new Visulaforce page. While creating the Page, You will find a salesforce editor. You can write your Visualforce content there. Or go to Setup -> My Personal Information -> Personal Information -> Edit check the checkbox development mode. When you run the page like this, https://ap1.salesforce.com/apex/MyTestPage. you will find the Page editor at the bottom of the page. You can write you page as well as the controller class associated with it, there it self. OR Using EclipseIDE you can create the Visulaforce page and write the code.

3 comments:

Batch Apex

1. What are transaction limits in apex? Total number of SOQL queries issued1 - 100 Total number of records retrieved by SOQL queries - 50...