Friday, May 24, 2013

What is Ajax?

The AJAX Toolkit is a JavaScript wrapper around the API:
  • The AJAX Toolkit is available for any organization that has API access.
  • The AJAX Toolkit supports Microsoft® Internet Explorer® versions 7, 8, 9, and 10 with the latest Microsoft hot fixes applied, and Mozilla® Firefox®, most recent stable version.
  • The AJAX Toolkit is based on the partner WSDL. Because there is no type checking in JavaScript, the type information available in the enterprise WSDL is not needed.
  • You can execute any call in the API, and access any API object that you normally have access to.
  • You can issue asynchronous calls, and use callback functions to handle the results.   
  • Asynchronous processing in Force.com is very important but has lower priority over real-time interaction via the browser and
    API. 
  • Message handlers run on the same application servers that process interactive requests, so it’s possible that asynchronous
    processing or increased interactive usage can cause a sudden increase in usage of computing resources. 
  • To ensure there are sufficient resources to handle a sudden increase, the queuing framework will monitor system resources such as server memory
    and CPU usage and reduce asynchronous processing when thresholds are exceeded. This will give resource priority to interactive requests.
  • Once the resources fall below thresholds, normal asynchronous processing will continue.

When to Use the AJAX in VisulaForce Page? 

  • Because information is delivered via a browser, AJAX works best with relatively small amounts of data (up to 200 records, approximately six fields with 50 characters of data each). The larger the data set returned, the more time it will take to construct and deconstruct a SOAP message, and as the size of an individual record gets larger, the impact on performance becomes greater. Also, as more HTML nodes are created from the data, the potential for poor performance increases. Because browsers are not efficient, careful consideration needs to be given to browser memory management if you intend to display a large amount of data.
  • The following are examples of appropriate uses:
    • Display or modify a single record.
    • Display two or three fields from many records.
    • Perform one or more simple calculations, then update a record.
    The following are examples of scenarios that require case-by-case analysis:
    • Update more than 200 records.
    • Update records that are unusually large. For example, what happens if the user clicks the browser stop button?
    • Recalculate a complex value for more than 200 records.

    An example of inappropriate usage is providing a sortable grid of many records. This would require too much processing time, and browser rendering would be too slow.

    Scenario:
    You want to use AJAX in a Visualforce page so that only part of the page needs to be refreshed when a user clicks a button or link.

    Use the reRender attribute on an <apex:commandLink> or <apex:commandButton> tag to identify the component that should be refreshed. When a user clicks the button or link, only the identified component and all of its child components are refreshed.

    For example, the following page shows a list of contacts. When a user clicks the name of a contact, only the area below the list refreshes, showing the details for the contact:


    Developers Can Use Embedded AJAX to Refresh Part of a Page
     
    VisualForce Page:
     
    <apex:page controller="contactController" showHeader="true"
               tabStyle="Contact">
      <apex:form>
        <apex:dataTable value="{!contacts}" var="c"
                        cellpadding="4" border="1">
          <apex:column>
            <apex:facet name="header"><b>Name</b></apex:facet>
            <apex:commandLink reRender="detail">{!c.name}
              <apex:param name="id" value="{!c.id}"/>
            </apex:commandLink>
          </apex:column>
          <apex:column>
            <apex:facet name="header"><b>Account Name</b></apex:facet>
            {!c.account.name}
          </apex:column>
        </apex:dataTable>
      </apex:form>
      <apex:outputPanel  id="detail">
        <apex:detail subject="{!contact}" title="false"
                     relatedList="false"/>
        <apex:relatedList list="ActivityHistories"
                          subject="{!contact}"/>
      </apex:outputPanel>
    </apex:page>
    Notice the following about the markup for this page:
    • Setting the reRender attribute of the <apex:commandLink> tag to 'detail' (the id value for the <apex:outputPanel> tag) means that only the output panel component is refreshed when a user clicks the name of a contact.
    • The <apex:param> tag sets the id query parameter for each contact name link to the ID of the associated contact record.
    • In the <apex:column> tags, an <apex:facet> tag is used to add the header row. Facets are special child components of some tags that can control the header, footer, or other special areas of the parent component. Even though the columns are in an iteration component (the data table), the facets only display once, in the header for each column.
    • In the <apex:outputPanel> tag, the details for the currently-selected contact are displayed without the detail section title or complete set of related lists; however, we can add individual related lists with the <apex:relatedList> tag.

    The following markup defines the Apex controller class for the page. It includes two methods: one to return a list of the ten most recently modified contacts and one to return a single contact record based on the id query parameter of the page URL:

    Controller:

    public class contactController 
    {
       // Return a list of the ten most recently modified contacts  
       public List<Contact> getContacts() 
       {
          return [SELECT Id, Name, Account.Name, Phone, Email
                  FROM Contact
                  ORDER BY LastModifiedDate DESC LIMIT 10];
       }
       /*Get the 'id' query parameter from the URL of the page If it's not
       specified, return an empty contact.  
       Otherwise, issue a SOQL query to return the contact from the database */.  
       public Contact getContact() 
       {
          Id id = System.currentPageReference().getParameters().get('id');
          return id == null ? new Contact() : [SELECT Id, Name
                                                 FROM Contact
                                                WHERE Id = :id];
       }
    }

Interfaces and Extending Classes in Apex

Interface:
An interface is like a class in which none of the methods have been implemented—the method signatures are there, but the body of each method is empty. To use an interface, another class must implement it by providing a body for all of the methods contained in the interface. 

Interfaces can provide a layer of abstraction to your code. They separate the specific implementation of a method from the declaration for that method. This way you can have different implementations of a method based on your specific application. 

Defining an interface is similar to defining a new class. For example, a company might have two types of purchase orders, ones that come from customers, and others that come from their employees. Both are a type of purchase order. Suppose you needed a method to provide a discount. The amount of the discount can depend on the type of purchase order. 

You can model the general concept of a purchase order as an interface and have specific implementations for customers and employees. In the following example the focus is only on the discount aspect of a purchase order.

public class PurchaseOrders 
{
 
    // An interface that defines what a purchase order looks like in general
     
   public interface PurchaseOrder 
   {
        // All other functionality excluded
        Double discount();
    }
 
    // One implementation of the interface for customers
    
    public virtual class CustomerPurchaseOrder implements PurchaseOrder 
    {
        public virtual Double discount() {
            return .05;  // Flat 5% discount
        }
    }

   // Employee purchase order extends Customer purchase order, but with a 
   // different discount
     
    public class EmployeePurchaseOrder extends CustomerPurchaseOrder
    {
          public  override Double discount() 
        {
            return .10;  // It’s worth it being an employee! 10% discount
        } 
   }    
}


 Notes:

  • The interface PurchaseOrder is defined as a general prototype. Methods defined within an interface have no access modifiers and contain just their signature.
  • The CustomerPurchaseOrder class implements this interface; therefore, it must provide a definition for the discount method. As with Java, any class that implements an interface must define all of the methods contained in the interface.
  • The employee version of the purchase order extends the customer version. A class extends another class using the keyword extends. A class can only extend one other class, but it can implement more than one interface.
  • When you define a new interface, you are defining a new data type. You can use an interface name in any place you can use another data type name. If you define a variable whose type is an interface, any object you assign to it must be an instance of a class that implements the interface, or a sub-interface data type.
  • An interface can extend another interface. As with classes, when an interface extends another interface, all the methods and properties of the extended interface are available to the extending interface.

Classes in Apex

Class Declaration in Apex:

To define a class, specify the following:
  1. Access modifiers:
    • You must use one of the access modifiers (such as public or global) in the declaration of a top-level class. 
    • If you use private access modifier for outer class it will rises an exception like "Top-level type must have public or global visibility". 
    • You do not have to use an access modifier in the declaration of an inner class.
  2. Optional definition modifiers (such as virtual, abstract, and so on)
  3. Required: The keyword class followed by the name of the class
  4. Optional extensions and/or implementations.

 Class Syntax:

 private | public | global ----->Access Modifiers
 [virtual | abstract |with sharing|without sharing|(none)]
 class ClassName [implements InterfaceNameList] [extends ClassName ] 
 { 
  // The body of the class
 }
 
  • The private access modifier declares that this class is only known locally, that is, only by this section of code. This is the default access for inner classes—that is, if you don't specify an access modifier for an inner class, it is considered private. This keyword can only be used with inner classes.
  • The public access modifier declares that this class is visible in your application or namespace.
  • The global access modifier declares that this class is known by all Apex code everywhere. All classes that contain methods defined with the webService keyword must be declared as global. If a method or inner class is declared as global, the outer, top-level class must also be defined as global.
  • The with sharing and without sharing keywords specify the sharing mode for this class. 
  • The virtual definition modifier declares that this class allows extension and overrides. You cannot override a method with the override keyword unless the class has been defined as virtual.
  • The abstract definition modifier declares that this class contains abstract methods, that is, methods that only have their signature declared and no body defined. 
  • In Apex, you can define top-level classes (also called outer classes) as well as inner classes, that is, a class defined within another class. You can only have inner classes one level deep.
 Notes:
  • You cannot add an abstract method to a global class after the class has been uploaded in a Managed - Released package version.
  • If the class in the Managed - Released package is virtual, the method that you can add to it must also be virtual and must have an implementation.
  • You cannot override a public or protected virtual method of a global class of an installed managed package.
  • A class can implement multiple interfaces, but only extend one existing class. This restriction means that Apex does not support multiple inheritance. The interface names in the list are separated by commas

 

Wednesday, May 22, 2013

Most Commonly Used Terms in SalesForce

Apex
A procedural scripting language that allows developers to execute flow and transaction control statements in the Force Platform environment. Apex code runs on Force Platform servers and is closely integrated with the Force Platform environment.
App
A collection of components such as tabs, reports, dashboards, and custom s-controls that address a specific business need. Short for “application.”
Analytic Snapshots
Used to capture and store data from a particular point in time.
Application programming interface (API)
The interface that a computer system, library, or application provides in order to allow other computer programs to request services from it and exchange data between them.
Apex-managed sharing
The ability to designate certain sharing entries as protected from deletion when sharing is recalculated.
Approval process
An automated process your organization can use to approve records on the platform. An approval process specifies the steps necessary for a record to be approved and who must approve it at each step. Approval processes also specify the actions to take when a record is approved, rejected, or first submitted for approval.
Auto number
A custom field type that automatically adds a unique sequential number to each record.
Cascading style sheets
Files that contain all of the information relevant to color, font, borders, and images that are displayed in a user interface.
Child relationship
A relationship that has been defined on an SObject that references a selected SObject as the “one” side of a one-to-many relationship. For example, if you expand the Child Relationships node under the Account object, contacts, opportunities, and tasks are included in this list.
Class, Apex
A template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables, exception types, and static initialization code. In most cases, Apex classes are modeled on their counterparts in Java and can be quickly understood by those who are familiar with them.
Cloud computing
A virtual development and deployment computing environment that eliminates the need for computing hardware and software infrastructure and components. Developers and users connect to this environment through a browser.
Component, Visualforce
An entity which can be added to a Visualforce page with a set of tags. You can create your own Visualforce components, which can contain multiple standard components.
Controller, Visualforce
An Apex class that provides a Visualforce page with the data and business logic it needs to run. Visualforce pages can use the standard controllers that come by default with every standard or custom object, or they can define custom controllers.
Custom field
Fields that can be added to customize an object for your organization’s needs.
Custom link
A custom URL defined by an administrator to integrate your data with external websites and back-office systems.
Custom object
An entity that you build to store information, analogous to a table in a relational database.
Dashboard
A graphical representation of data from up to 20 summary or matrix reports arranged in a two- or three-column layout. Every user can select a favorite dashboard to display on his or her Home tab.
Data Loader
A Force Platform tool used to import and export data from your Force Platform organization.
Dependent field
Any custom picklist or multi-select picklist field that displays available values based on the value selected in its corresponding controlling field.
Delegated authentication
An security process where an external authority is used to authenticate Force Platform users.
Developer Edition
A free Salesforce edition that allows you to get hands-on experience with all aspects of the platform in an environment designed for development. Developer Edition accounts are available at developer.force.com.
Developer Force
The Developer Force website at developer.force.com provides a full range of resources for platform developers, including sample code, toolkits, an online developer community, and the ability to obtain limited Force Platform environments.
DML statement
An Apex statement that inserts, updates, or deletes records from the Force Platform database.
Email template
A built-in feature that enables you to create form emails that communicate a standard message, such as a welcome letter to new employees or an acknowledgement that a customer service request has been received.
Email service
A service set up for your Force Platform organization that can receive incoming emails and direct them to an Apex class for processing.
Enterprise Edition
A Salesforce edition designed to meet the needs of larger, more complex businesses. In addition to all of the functionality available in Professional Edition, Enterprise Edition organizations get advanced customization and administration tools that can support large-scale deployments.
Field
A part of an object that holds a specific piece of information, such as a text or currency value.
Field dependency
A filter that allows you to change the contents of a picklist based on the value of another field.
Field-level security
Settings that determine whether fields are hidden, visible, read only, or editable for users based on their profiles.
Force Platform
A platform for building cloud computing applications from salesforce.com. The Force Platform provides a full stack of default and extensible functionality which allows you to create cloud computing applications for your entire enterprise.
Force Platform API
A Web services-based application programming interface that provides access to your Salesforce organization’s information.
Force Platform AppExchange
A Web directory where hundreds of AppExchange apps are available to Salesforce customers to review, demo, comment upon, and/or install. Developers can submit their apps for listing on AppExchange if they wish to share them with the community.
Force Platform IDE
An Eclipse plug-in that allows developers to manage, author, debug and deploy Force Platform applications classes and triggers in the Eclipse development environment.
Force Platform Migration Tool
A toolkit that allows you to write an Apache Ant build script for migrating Force Platform applications and components between two Salesforce organizations.
Force Platform Sites
A feature that allows access to Force Platform applications by users outside of a Force Platform organization.
Formula field
A type of custom field that automatically calculates its value based on the values of merge fields, expressions, or other values.
Group
A set of users that can contain individual users, other groups, or the users in a role. Groups can be used to help define sharing access to data.
Group Edition
A Salesforce edition designed for small businesses and workgroups with a limited number of users. Group Edition offers access to accounts, contacts, opportunities, leads, cases, dashboards, and reports.
Home tab
The starting page from which users can view a dashboard, choose sidebar shortcuts and options, view current tasks and activities, or select each of the major tabs.
ID
A unique 15- or 18-character alphanumeric string that identifies a single record in Salesforce.
Import Wizard
An tool for importing data into your Force Platform organization, accessible from the Setup menu.
Instance
A server that hosts an organization’s Force Platform data and runs their applications. The platform runs on multiple instances, but data for any single organization is always consolidated on a single instance.
Junction object
A custom object that implements a many-to-many relationship between two other objects.
Lookup relationship
A relationship between two objects that allows you to associate records with each other. On one side of the relationship, a lookup field allows users to click a lookup icon and select another record from a list. On the associated record, you can then display a related list to show all of the records that have been linked to it.
Managed package
A collection of application components that are posted as a unit on Force Platform AppExchange, and that are associated with a namespace and a License Management Organization. A package must be managed for it to be published publicly on AppExchange, and for it to support upgrades.
Many-to-many relationship
A relationship where each side of the relationship can have many children on the other side. Implemented through the use of junction objects.
Manual sharing
Record-level access rule that allows record owners to give read and edit permissions to other users who might not have access to the record any other way.
Matrix report
A report that presents data summarized in two dimensions, like a spreadsheet.
Metadata
The foundation of Force Platform applications. Metadata is used to shape the functionality and appearance of Force Platform applications. A developer modifies the metadata to create an application, and the Force Platform uses metadata to create application components as needed.
Merge field
A field you can place in an email template, custom link, or formula to incorporate values from a record. For example, Dear {!Contact.FirstName}, uses a contact merge field to obtain the value of a contact record’s First Name field to address an email recipient by his or her first name.
Mini-Page Layout
A reduced display of information about a record that can be enabled to display when a user leaves their mouse on a link to the record.
Multitenancy
An application model where all users and apps share a single, common infrastructure and code base.
MVC (Model-View-Controller)
A design paradigm that deconstructs applications into components that represent data (the model), ways of displaying that data in a user interface (the view), and ways of manipulating that data with business logic (the controller).
Namespace
A one- to 15-character alphanumeric identifier that distinguishes your package and its contents from packages of other developers on Force PlatformAppExchange, similar to a domain name. Salesforce automatically prepends your namespace prefix, followed by two underscores (“__”), to all unique component names in your Salesforce organization.
Object
In Force Platform terms, an object is similar to a database table—a list of information, presented with rows and columns, about the person, thing, or concept you want to track. An object is the core component of the data-driven Force Platform environment, with automatically generated user interfaces, a security and sharing model, workflow processes, and much more.
Object-level security
Settings that allow an administrator to hide whole tabs and objects from a user, so that they don’t even know that type of data exists. On the platform, you set object-level access rules with object permissions on user profiles.
One-to-many relationship
A relationship in which a single object is related to many other objects. For example, each Candidate may have one or more related Job Applications.
Organization, or org
The virtual space provided to an individual customer of salesforce.com. Your org includes all of your data and applications, and your org is separate from all other organizations.
Organization-wide defaults
Settings that allow you to specify the baseline level of data access that a user has in your organization. For example, you can make it so that any user can see any record of a particular object that’s enabled in their user profile, but that they’ll need extra permissions to actually edit one.
Outbound message
A SOAP message from Salesforce to an external Web service. You can send outbound messages from a workflow rule or Apex.
Package
A group of Force Platform components and applications that are made available to other organizations through a publish and subscribe architecture.
Page layout
The organization of fields, custom links, related lists, and other components on a record detail or edit page. Use page layouts primarily for organizing pages for your users, rather than for security.
Personal Edition
A free Salesforce edition designed for an individual sales representative or other single user. Personal Edition provides access to key contact management features such as accounts, contacts, and synchronization with Outlook. It also provides sales representatives with critical sales tools such as opportunities.
Picklist
A selection list of options available for specific fields, for example, the Country field for a Candidate object. Users can choose a single value from a list of options rather than make an entry directly in the field.
Picklist values
The selections displayed in drop-down lists for particular fields. Some values come predefined, and other values can be changed or defined by an administrator.
Platform Edition
A Salesforce edition based on either Enterprise Edition or Unlimited Edition that does not include any of the standard Salesforce CRM apps, such as Sales or Service & Support.
Production organization
A Salesforce organization that has live users accessing data.
Professional Edition
A Salesforce edition designed for businesses who need full-featured CRM functionality. Professional Edition includes straightforward and easy-to-use customization, integration, and administration tools to facilitate any small- to mid-sized deployment.
Profile
A component of the platform that defines a user’s permission to perform different functions. The platform includes a set of standard profiles with every organization, and administrators can also define custom profiles to satisfy business needs.
Queue
A collection of records that don’t have an owner. Users who have access to a queue can examine every record that’s in it and claim ownership of the records they want.
Record
A single instance of an object. For example, Software Engineer is a single Position object record.
Record name
A standard field on all Force Platform objects. Whenever a record name is displayed in a Force Platform application, the value is represented as a link to a detail view of the record. A record name can be either free-form text or an autonumber field. The Record Name does not have to be a unique value.
Record-level security
A method of controlling data in which we can allow particular users to view and edit an object, but then restrict the individual object records that they’re allowed to see.
Related list
A section of a record or other detail page that lists items related to that record.
Relationship
A connection between two objects in which matching values in a specified field in both objects are used to link related data. For example, if one object stores data about companies and another object stores data about people, a relationship allows you to find out which people work at the company.
Report types
The foundation of Force Platform reports. A report type specifies the objects and their fields that can be used as the basis of a report. Standard report types are created by the Force Platform, while you can create custom report types for more advanced or specific reporting requirements.
Role hierarchy
A record-level security setting that defines different levels of users such that users at higher levels can view and edit information owned by or shared with users beneath them in the role hierarchy, regardless of the organization-wide sharing model settings.
Roll-Up Summary Field
A field type that automatically provides aggregate values from child records in a master-detail relationship.
S-Control
A component that allows you to embed custom HTML and JavaScript into Salesforce detail pages, custom links, Web tabs, or custom buttons. For example, you can define a custom s-control containing JavaScript and address merge fields to display a map of a contact’s address. The functionality provided by s-controls has been replaced by Visualforce.
Sandbox organization
A nearly identical copy of a Salesforce production organization. You can create multiple sandboxes in separate environments for a variety of purposes, such as testing and training, without compromising the data and applications in your production environment.
Search layout
The organization of fields included in search results, lookup dialogs, and the recent items lists on tab home pages.
Session ID
An authentication token that’s returned when a user successfully logs in to Salesforce. The Session ID prevents a user from having to log in again every time he or she wants to perform another action in Salesforce.
Session timeout
The amount of time a single session ID remains valid before expiring. While a session is always valid for a user while he or she is working in the Web interface, sessions instantiated via the API expire after the duration of the session timeout, regardless of how many transactions are still taking place.
Setup menu
Interface to Force Platform metadata that allows you to create and shape Force Platform applications. You get access to the Setup menu through the Setup link in a standard Force Platform application.
Sharing model
A security model that defines the default organization-wide access levels that users have to each other’s information.
Sharing rules
Rules that allow an administrator to specify that all information created by users within a given group or role is automatically shared to the members of another group or role. Sharing rules also allow administrators to make automatic exceptions to org-wide defaults for particular groups of users.
SOQL (Salesforce Object Query Language)
A query language that allows you to construct simple but powerful query strings and to specify the criteria that should be used to select the data from the database.
SOSL (Salesforce Object Search Language)
A query language that allows you to perform text-based searches using the API.
Standard object
A built-in object included with the Force Platform. You can also build custom objects to store information that’s unique to your app.
Tab
An interface item that allows you to navigate around an app. A tab serves as the starting point for viewing, editing, and entering information for a particular object. When you click a tab at the top of the page, the corresponding tab home page for that object appears. A tab can be associated with a Force Platform object, a web page or a Visualforce page.
Tag
An identifier that can be attached by a user to an individual record. Force Platform tags can be public or private.
Test method
An Apex class method that verifies whether a particular piece of code is working properly. Test methods take no arguments, commit no data to the database, and can be executed by the runTests() system method either via the command line or in an Apex IDE, such as Eclipse with the Force Platform IDE.
Time-dependent workflow action
A workflow action that occurs before or after a certain amount of time has elapsed. Time-dependent workflow actions can fire tasks, field updates, outbound messages, and email alerts while the condition of a workflow rule remains true.
Trigger
A piece of Apex that executes before or after records of a particular type are inserted, updated, or deleted from the database. Every trigger runs with a set of context variables that provide access to the records that caused the trigger to fire, and all triggers run in bulk mode—that is, they process several records at once, rather than just one record at a time.
Trigger context variables
Default variables that provide access to information about the trigger and the records that caused it to fire.
Unlimited Edition
A Salesforce edition designed to extend customer success through the entire enterprise. Unlimited Edition includes all Enterprise Edition functionality, plus Apex, Force Platform Sandbox, Force Platform Mobile, premium support, and additional storage.
Unmanaged package
A Force Platform AppExchange package that cannot be upgraded or controlled by its developer. Unmanaged packages allow you to take any app components and move them “as is” to AppExchange without going through a lengthy publishing process.
URL (Uniform Resource Locator)
The global address of a website, document, or other resource on the Internet. For example, http://www.salesforce.com.
Validation rule
A rule that prevents a record from being saved if it does not meet the standards that are specified.
Visualforce
A simple, tag-based markup language that allows developers to easily define custom pages and components for apps built on the platform. Each tag corresponds to a coarse or fine-grained component, such as a section of a page, a related list, or a field. The components can either be controlled by the same logic that’s used in standard Salesforce pages, or developers can associate their own logic with a controller written in Apex.
Web service
A mechanism by which two applications can easily exchange data over the Internet, even if they run on different platforms, are written in different languages, or are geographically remote from each other.
WebService method
An Apex class method or variable that can be used by external systems, such as an s-control or mash-up with a third-party application. Web service methods must be defined in a global class.
Web tab
A custom tab that allows your users to use external websites from within the application.
Wizard
A user interface that leads a user through a complex task in multiple steps.
Workflow action
An email alert, field update, outbound message, or task that fires when the conditions of a workflow rule are met.
Workflow email alert
A workflow action that sends an email when a workflow rule is triggered. Unlike workflow tasks, which can only be assigned to application users, workflow alerts can be sent to any user or contact, as long as they have a valid email address.
Workflow field update
A workflow action that changes the value of a particular field on a record when a workflow rule is triggered.
Workflow outbound message
A workflow action that sends data to an external Web service, such as another cloud computing application. Outbound messages are used primarily with composite apps.
Workflow queue
A list of workflow actions that are scheduled to fire based on workflow rules that have one or more time-dependent workflow actions.
Workflow rule
A “container” for a set of workflow instructions that includes the criteria for when the workflow should be activated, as well as the particular tasks, alerts, and field updates that should take place when the criteria for that rule are met.
Workflow task
A workflow action that assigns a task to an application user when a workflow rule is triggered.

Trigger.new vs Trigger.old  


Trigger.new

     Trigger.new stores new values of a record. This basically means that when you edit a record and save it, your trigger would be called and the values that you have changed will be available in 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  

       Trigger.old stores the old values of a record. This basically means that when you edit a record and save it, your trigger would be called and the values that were available before you edited the record would be stored in 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.

Context Variable Considerations 

1.Trigger.new and trigger.old cannot be used in Apex DML operations.

2.You can use an object to change its own field values using trigger.new, but only in before triggers.

3.In all after triggers, trigger.new is not saved, so a runtime exception is thrown.

4.Trigger.old is always read-only.You cannot delete trigger.new.

Tuesday, May 21, 2013

Search Anything in One Page


Search Anything in One Page 

      Now you can search Classes,VF pages,Triggers,Fields,Layout etc in a single click and edit or open in one click.

Steps To Install:

1.Open the Url http://lnkd.in/av8T8B

2.Click on continue
   


 

3.Click on Next and Next.

Step 1.Approve package API Access



Step 2.Choose Security Level

 

Step 3.Install Package

  

4. Goto the App menu select the Search Anything app.

5.Click on SearchAnything Tab and select any one option to search.

6.It will generate an error message with server address.Copy that address  i.e.,https://z-search.ap1.visual.force.com/services/Soap/m/26.0

7.Admin setup -->Security-->Remotesite Settings-->NewRemote Site address

     RemoteSiteAName            : Your Choice.
     Remote Site URL              :  Url of 6 th Step.
     Disable Protocol Security  :  Check the checkbox.

8. Save the Settings.

9. Click on SearchAnyThing Tab and search for your choice.

                    
                               ENJOY WITH SALESFORCE  







 

Generation Of PreLoaders

                                       
Mostly commonly we observe these types of symbols when we submit any form.These symbols are called PreLoaders.If you want to genetrate these symbols and to place in your application follow the steps below.

1.visit the following link and select your own preloader and download  it
http://preloaders.net/

2.Upload the downloaded preloader in Static Resources.

3.Use those preloaders where you need i.e.,Apex Pages and Apex classes.




Monday, May 20, 2013

Creating Your First Cloud App with Salesforce.com

Creating Your First Cloud App with Salesforce.com

  Hi Friends visit the below link to view step-by-step process and screen shots for creation of your First Cloud App.

http://www.nearsoft.com/blog/creating-your-first-cloud-app-with-salesforcecom.html

Summer '13 Cheat Sheet

Source: Salesforce.com

 

 

 

Summer '13 Cheat Sheet

The Summer ’13 release notes are out and it is going to be a robust rollout! Please read on for the release snapshot.

Platform Updates

Chatter

Communities is a great way to collaborate with people outside your company who are key stakeholders for your business.  User can share information including reports and dashboards with external users. Two main uses for Communities are to:
  • Improve Sales by allowing reps to share information with vendors, resellers, partners, and customers.
  • Enhancing service functions by allowing customers to collaborate amongst each other.
Chatter Publisher is the tool bar that allows users to perform actions such as, post comments, share files or links and contribute a poll to a chatter feed. Salesforce has released a new feature to manage actions, administrators can add new actions or modify the order in which standard actions appear. This feature is replacing tasks in feeds (rolled out in the Spring '13 release).
Chatter Topics is a feature that allows user to organize their feed. They can add topics (categories similar to #) to posts. This feature will allow all posts tagged with a certain topic to be filterable to show up in a single feed.

Analytics

Enhanced sharing for Reports & Dashboards. Allows for more flexibility in the security model of Report & Dashboard folders rather than the Profile setting Manage Reports & Dashboards. New permissions include:
  • Create and Customize Reports / Dashboard Folders
  • Create and Customize Reports / Dashboards
Sticky Dashboard Filters remember your latest chosen filter selections. This means that a dashboard will always filter data based on your previous view.

Mobile

Salesforce Touch is a version of Salesforce that’s designed for smartphone devices with touch screens. Some enhancements rolling out this summer are:
  • Ability to see contacts’ Twitter pictures and profiles
  • View Dashboards
  • Access to Communities
  • Viewing data even when offline

Data.com

Social Key - Beta is an enhancement to the Data.com Clean feature. It works with Social Accounts and Contacts so when cleaning your data it also queries to pull down social handles from Twitter, LinkedIn and Facebook.

Force.com

User Interfaces
  • The Setup Pageuser interface has been updated. It is now segmented into five  high-level sections: Administer, Build, Deploy, Monitor and Checkout.
  • The My Settings have also been updated to show more explanatory categories for the standard user: Personal, Display & Layout, Email, Chatter, Calendar & Reminders, Desktop Add-ons, and Import
  • The Developer Console is grouped into the following sections: File, Debug, Test, Workspace, and Help.
 Formulas
  • Owner fields can now drill down to the Owner's user record to pull back relevant information.
  • Checkbox format is now an option for formula fields for returning a value of true or false.
  • Formula editors now uses monospace format. This should make debugging formula field simpler.

SalesCloud Updates


Quantities can now be used in Forecasting and for Quotas (similar to how they can be used in revenue scheduling). This feature is great for companies that track sales by total quantity sold. I can see it being helpful for the Digital Advertising industry to forecast impressions for their online campaigns.
Opportunity Splits is a feature that has been a long time coming and has been asked for by  at least 85% of my clients. In the past custom applications were required to perform this functionality which required fairly heavy development. This feature will easily allow team selling and credit allocation across multiple users.
Pricebooks are now customizable as most standard object are. The object will allow for custom fields and will have its own standard tab. There are two purposes I see this functionality providing:
  • Companies may have seasonal price books that are only relevant certain times of the year. Custom date fields can be used to specify the start and end dates during which the price book is active.
  • Companies with different business divisions can set up specific page layouts each groups within your organization.
Salesforce for Outlook now works with shared activities. Emails can be added to multiple Lead or Contact records and related cases are now visible in the side panel.

ServiceCloud Updates

Entitlement versioning lets users make changes to existing entitlement processes (milestones) when company business rules change without deactivating or deleting the entire entitlement.
Knowledge Base is getting a facelift, Knowledge One - Beta is now available. Features include SmartLinks. Previously, links in Salesforce Knowledge articles to other Salesforce Knowledge articles were hard coded, causing broken links when the linked article’s URL_Name was changed. Now, when the URL Name of the linked article is changed, Salesforce Knowledge automatically updates the article’s URL based on the channel, adds the site prefix for a public knowledge base, and adds the community name for the community portal.
LiveAgent was a focus in the Summer release as it has many enhancements.
  •  A Live Agent sessions page was added to allow users to find information about support agents’ activities while they’re online.
  • Reporting is now available on we’ve Live Agent chat sessions to view data about your agents’ activity while they support customers.
  •  Previously, Live Agent only tracked transfers that occurred during a chat. There are more options available for Live Chat Transcript Events on the Live Chat Transcript Detail page to allow activity tracking that take place between agents and customers during a chat. 
  • LiveAgent Supervisor page can now view: Chats assigned but not yet answered, ongoing chat transcripts, and send whisper messages (for training purposes).

Friday, May 17, 2013

Interview Questions for Salesforce Developers with answers

Check Out Topic Wise Top Interview Questions With Answers.New

1. Through Sales force Import wizard how many records we can import?
Using Import wizard, we can upload up to 50000 records.

2. Import wizard will support for which Objects?
Only Accounts, Contacts and custom object’s data can be imported.  If we want to import other objects like Opportunities and other object’s data, then we need to go for Apex Data Loader.

3. What is app exchange?
The developed custom applications can be uploaded into the app exchange so that the other person can share the applicaition.

4. What is a VLOOKUP in S.F?
VLOOKUP is actually a function in sales force which is used to bring relevant value to that record from another record automatically.

5. When I want to export data into SF from Apex Data Loader, which Option should be enable in Profile?
Enable API

6. What is a web - lead?
Capturing a lead from a website and routing it into lead object in Sales Force is called wed-lead (web to lead).

7. What are the Types of Account and difference between them?
We have two types of accounts.
Personal accounts
Business accounts

In personal accounts, person’s name will be taken as primary considerations where as in business accounts, there will be no person name, but company name will be taken into consideration.

8. What is a Wrapper Class in S.F?
A wrapper class is a class whose instances are collections of other objects.

9. What are formula and Rollup Summary fields and Difference between them? When should Rollup- Summary field enable?
Formula: A read-only field that derives its value from a formula expression that we define. The formula field is updated when any of the source fields change.
Rollup Summary: A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list. 

10. What is a Sandbox? What are all the Types of sandboxex?
Sandbox is the exact replica of the production.
3 Types:
Configuration
Developer
Full

11. What is the difference between custom controller and extension?

Custom Controller: A custom controller is an Apex class that implements all of the logic for a page without leveraging a standard controller. Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user.  
Controller extension: controller extension is an Apex class that extends the functionality of a standard or custom controller.
 
Although custom controllers and controller extension classes execute in system mode and thereby ignore user permissions and field-level security, you can choose whether they respect a user's organization-wide defaults, role hierarchy, and sharing rules by using the with sharing keywords in the class definition.

12. What are different kinds of reports?

1. Tabular: Tabular reports are the simplest and fastest way to look at data. Similar to a spreadsheet, they consist simply of an ordered set of fields in columns, with each matching record listed in a row. Tabular reports are best for creating lists of records or a list with a single grand total. They can't be used to create groups of data or charts, and can't be used in dashboards unless rows are limited. Examples include contact mailing lists and activity reports.
2. Summary: Summary reports are similar to tabular reports, but also allow users to group rows of data, view subtotals, and create charts. They can be used as the source report for dashboard components. Use this type for a report to show subtotals based on the value of a particular field or when you want to create a hierarchical list, such as all opportunities for your team, subtotaled by Stage and Owner. Summary reports with no groupings show as tabular reports on the report run page.
3. Matrix: Matrix reports are similar to summary reports but allow you to group and summarize data by both rows and columns. They can be used as the source report for dashboard components. Use this type for comparing related totals, especially if you have large amounts of data to summarize and you need to compare values in several different fields, or you want to look at data by date and by product, person, or geography. Matrix reports without at least one row and one column grouping show as summary reports on the report run page.
4. Joined: Joined reports let you create multiple report blocks that provide different views of your data. Each block acts like a “sub-report,” with its own fields, columns, sorting, and filtering. A joined report can even contain data from different report types.

13. What are different kinds of dashboard component?

  Chart: Use a chart when you want to show data graphically.
  Gauge: Use a gauge when you have a single value that you want to show          within a range of custom values.
  Metric: Use a metric when you have one key value to display.
  • Enter metric labels directly on components by clicking the empty text field next to the grand total.
  • Metric components placed directly above and below each other in a dashboard column are displayed together as a single component.
 Table: Use a table to show a set of report data in column form.
 Visualforce Page: Use a Visualforce page when you want to create a custom component or show information not available in another component type
 Custom S-Control: Custom S-Controls can contain any type of content that you can display or run in a browser, for example, a Java applet, an ActiveX control, an Excel file, or a custom HTML Web form.

14. How to schedule a class in Apex?

To invoke Apex classes to run at specific times, first implement the Schedulable interface for the class, then specify the schedule using either the Schedule Apex page in the Salesforce user interface, or the System.schedule method.
After you implement a class with the Schedulable interface, use the System.Schedule method to execute it. The scheduler runs as system: all classes are executed, whether the user has permission to execute the class or not.
The System.Schedule method takes three arguments: a name for the job, an expression used to represent the time and date the job is scheduled to run, and the name of the class.
Salesforce only adds the process to the queue at the scheduled time. Actual execution may be delayed based on service availability. The System.Schedule method uses the user's time zone for the basis of all schedules. You can only have 25 classes scheduled at one time.

15. What is PermissionSet?

PermissionSet represents a set of permissions that’s used to grant additional access to one or more users without changing their profile or reassigning profiles. You can use permission sets to grant access, but not to deny access.
Every PermissionSet is associated with a user license. You can only assign permission sets to users who have the same user license that’s associated with the permission set. If you want to assign similar permissions to users with different licenses, create multiple permission sets with the same permissions, but with different licenses.

16. What are governor limits in Salesforc.com?

Governor limits are runtime limits enforced by the Apex runtime engine. Because Apex runs in a shared, multitenant environment, the Apex runtime engine strictly enforces a number of limits to ensure that code does not monopolize shared resources. Types of limits that Apex enforces are resources like memory, database resources, number of script statements to avoid infinite loops, and number of records being processed. If code exceeds a limit, the associated governor issues a runtime exception that cannot be handled thereby terminating the request.

17. What are custom settings?

Custom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. All custom settings data is exposed in the application cache, which enables efficient access without the cost of repeated queries to the database. This data can then be used by formula fields, validation rules, Apex, and the SOAP API.

There are two types of 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. 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.
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.

18. What are different portals in Salesforce.com?
  
Partner Portal:
A partner portal allows partner users to log in to Salesforce.com through a separate website than non-partner users. Partner users can only view & edit data that has been made available to them. An organization can have multiple partner portals.

Customer Portal:
Customer Portal provides an online support channel for customers allowing them to resolve their inquiries without contacting a customer service representative. An organization can have multiple customer portals.

19. What is the use of Salesforce.com Sites?

Force.com Sites enables you to create public websites and applications that are directly integrated with your Salesforce organization without requiring users to log in with a username and password. You can publicly expose any information stored in your organization through a branded URL of your choice. Sites are hosted on Force.com servers and built on native Visualforce pages. You can user authentication to a public site using customer portal.

20. What actions can be performed using Workflows?
 
  Email Alert:
Email alerts are workflow and approval actions that are generated using an email template by a workflow rule or approval process and sent to designated recipients, either Salesforce users or others. Workflow alerts can be sent to any user or contact, as long as they have a valid email address.
  Field Update:
Field updates are workflow and approval actions that specify the field you want updated and the new value for it. Depending on the type of field, you can choose to apply a specific value, make the value blank, or calculate a value based on a formula you create.
  Task:
Assigns a task to a user you specify. You can specify the Subject, Status, Priority, and Due Dateof the task. Tasks are workflow and approval actions that are triggered by workflow rules or approval processes.
  Outbound Message:
An outbound message is a workflow, approval, or milestone action that sends the information you specify to an endpoint you designate, such as an external service. An outbound message sends the data in the specified fields in the form of a SOAP message to the endpoint. 
  
21. Workflow rules can perform which of the following actions using standard Salesforce.com functionality?
   
A.     Update a Field
B.     Send an Outbound Message
C.     Send an Email
D.     Create a Task


22. The Organization ID (Org ID) of a sandbox environment is the same as its production environment.
   
    False

23. Jim is a Salesforce.com system administrator for Universal Products Inc (UPI).  UPI currently uses org-wide public read/write for accounts. The sales department is concerned with sales reps being able to see each other's account data, and would like sales reps to only be able to view their own accounts.  Sales managers should be able to view and edit all accounts owned by sales reps. The marketing department at UPI must be able to view all sales representative's accounts at UPI. What steps must be configured in order to meet these requirements?
   
A.  Change Org-Wide Security for Accounts to Private
B.  Add Sharing Rule to Provide Read Access to Marketing for Sales Representative's Accounts
C.  Configure Roles:
Executive
-Marketing (Subordinate of Executive)
-Sales Management (Subordinate of Executive)
--Sales Representatives (Subordinate of Sales Management)


24. The Data Loader can be used with Group Edition.
   
   False

25. What type of object relationship best describes the relationship between Campaigns and Leads (using standard Salesforce functionality)?
   
   Many to Many

26. Which of the following are not valid Salesforce license types?
   
A.     Service Cloud
B.     Platform (Force.com)
C.     Customer Portal
D.     Gold Edition
E.     Unlimited Edition
F.     Platinum Portal
Ans:D


27. Which of the following are either current or future planned offerings by Salesforce.com or its subsidiaries?
   
A.     Touch
B.     Flow / Visual Process Manager
C.     Heroku
D.     Sites / Siteforce
Ans:All

28. Bob is a Salesforce.com consultant and is responsible for the data migration of an implmentation for his client, Universal Systems Inc (USI). 

USI wants to migrate contacts and accounts from their legacy CRM system, which has a similar data model (many contacts per one account; primary keys exist on contact and account).

USI has provided Bob an export in CSV format of contacts and accounts of their legacy CRM system. What method should Bob use to migrate the data from the legacy system into Salesforce?

   
A.     An ETL or similar data migration tool must be used
B.     Create an external ID for account and use the data loader to upsert the data with relationships intact
C.     Insert accounts into Salesforce and use Excel vlookup to match the legacy ID to the Salesforce ID in order to insert associated contacts
Ans:B

29. Universal Products Inc (UPI) wants to perform a drip marketing campaign on leads generated through website submissions.  What is the ideal method to execute this type of campaign?
   
A.     Use Salesforce campaign management and series of workflow rules
B.     Integrate Salesforce with a 3rd party vendor to perform marketing   automation
C.     Export the data from Salesforce and manually send via 3rd party tool
Ans:B

30. Which of the following are not valid ways to migrate metadata?
   
A.     Data Loader
B.     Change Sets
C.     Force.com IDE
D.     ANT Migration Toolkit 
Ans:A


Please comment or write us if you have any queries/requirements.

Please like,follow,bookmark,subscribe this site to receive daily updates.





Hope this helps you..Enjoy..!