Difference between Database.query() and Database.getQueryLocator



Database.query()
Database.getQueryLocator
We can retrieve up to 50,000 records.
We can retrieve up to 10,000 records.
If VF page doesn’t have read only attribute, use Database.query().
If VF page have read only attribute, use Database.getQueryLocator().
In Batch Apex, if we use Database.query(), it supports 50,000 records only.
In Batch Apex, if we use Database.getQueryLocator(), it supports upto 50 million records.

Cheers!!!

Sub Modules of CRM

A Typical CRM consists of 3 Sub Modules:

•        Marketing (Lead, Campaign, Account and Contact Management)

•        Sales (Account, Contact and Opportunity Management)

•        Services (Account, Contact, Cases and Solutions Management)

Cheers!!!

How to add Javascript to Standard Pagelayout in Salesforce?

To add Javascript to Standard Pagelayout in Salesforce, add a HTML Home page Component with HTML checkbox checked.


Sample Javascript:

<style type="text/css">
#popup
{
display:none;
position:absolute;
height:100px;
width:100px;
background:#E6E6FA;     
border: 2px solid black;
overflow:auto;
}
#cls
{
color:red;
text-align:right;
}
</style>

<script type="text/javascript" src="/soap/ajax/22.0/connection.js"></script>

<script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready( function(){

        $(".dataCell").click(function(event){   
            $("#popup").css( {position: "absolute", top:event.pageY - 110, left: event.pageX});
            var temp = $(this).prev(".dataCell").find("a").attr("href");
            var depLink = temp.substring(1);           
            var qryString = "SELECT Description__c FROM Dependent__c where Id = '" + depLink + "'";
            sforce.connection.sessionId = getCookie('sid');
            var soql = qryString.toString();
           
            var result = sforce.connection.query(soql);   
           
            var records = result.getArray("records");
            for (var i = 0; i < records.length; i++)
            {
                var taskRecord = records[i];
                $("#cont").html(taskRecord.Description__c);
            }           
           
            showBox();
        });

        $("#cls").click(function(){
            hideBox();
        });

        function showBox()
        {
            $('#popup').fadeIn("slow");
        }
        function hideBox()
        {
            $('#popup').fadeOut("slow");
        }
    });
</script>
<div id="popup">
    <div id="cls">
    <a href="#" style="color:red;">X</a><br/>
    </div>
    <div id="cont"></div>
</div>


Output:


CSS is not working

If applied CSS is not working, then try to avoid blank spaces in the CSS.

Good CSS:

#popup
{
display:none;
position:absolute;
height:100px;
width:100px;
background:#E6E6FA;     
border: 2px solid black;
overflow:auto;
}


Bad CSS:

#popup
{

    display:none;
    position:absolute;
    height:100px;
    width:100px;
    background:#E6E6FA;     
    border: 2px solid black;
    overflow:auto;
}

Cheers!!!

Tags in Salesforce

 Tags are words or short phrases that you can associate with most Salesforce records to describe and organize their data in a personalized way. Use tags to group records from various objects by a common topic or use, and then use those tags in search to make finding information fast and intuitive.

Types of tags:

    1. Personal tags are private. Only you can view any personal tags that you add to a record.
    2. Public tags are shared among all users in an organization. Any user with access to the record can view the public tags that you add.

Administrators can enable personal and public tags for accounts, activities, assets, campaigns, cases, contacts, contracts, dashboards, documents, events, leads, notes, opportunities, reports, solutions, tasks and for any custom objects.

In order to enable Tags, go to Setup --> Customize --> Tags --> Tag Settings.


For Public tags, kindly check Public Tags and for Personal Tags, kindly select Personal Tags.


 To add, tag to a record, kindly click "Add Tags" button.


Give a name to the tag and save it.


Search the tag name in the Search bar.


Output:


Limitations:

For all editions, a user is limited to a maximum of: 

• 500 unique personal tags
• 5,000 instances of personal tags applied to records

Across all users, your organization can have a maximum of:

• 1,000 unique public tags
• 50,000 instances of public tags applied to records
• 5,000,000 instances of personal and public tags applied to records

Cheers!!!

ADM 201 Book

How to add custom button to related list in Salesforce?

1. Create a List Custom button on child object.


2. Go the parent object.

3. Edit the page layout.

4. Go to related list.

5. Click 'Settings' icon.


6. Select the button to be displayed.



7. Click 'Save'.


Cheers!!!

How to create custom tab style in Salesforce?

1. Go to Documents tab.


2. Add a image less than 20kb in size.

3. Check "Externally Available Image" checkbox without fail.


 4. Go to App setu --> Create --> Tabs and click "New" button.


 5. Click the magnifying glass icon next to Tab style and click "Create your own style" button.




6. Select Color and icon from the image stored in Documents.


This dialog only lists files in document folders that are under 20 KB and have the Externally Available checkbox selected in the document property settings. If the document used for the icon is later deleted, Salesforce replaces it with a default multicolor block icon (Default Block Icon).

Ouputs:


Freshers Drive


"Connecting Fresh Talent with Right Opportunity"

Freshers Drive on 18th May 2013

Who are eligible-
• B.E/B.Tech/M.Tech/M.E/MCA/M.Sc (IT/CS Branches ONLY)
• 70% minimum throughout the education (Compulsory)
• Only 2012 & 2013 Batch will be considered

Interview Date: 18-05-2013
Registration Timings: 8.00 AM to 9.00 AM
Interview Timings: 9.00 AM Onwards

Interview Procedure-
• Aptitude Test (1 hr)
• Essay Writing (1/2 hr)
• Group Discussion
• Personal Interview

Documents to be carried:
• Hard Copy of the profile
• One passport size photograph

Venue Details - HighRadius Technologies Pvt. Ltd.
Ektha Pearl, 4th Floor, 1st Lane, White Fields,
BP Raju Marg, Kondapur, Hyderabad-500084.

Salesforce Interview questions with answers Part 13

1. In Data loader using upsert operation can u do update a record if that record id is already exist in page and if updated that record then can u update 2records with having same id and if not updated 2 records then wat error message is given?

It is not possible to update records with same id in a file usin upsert operation. It will throw "duplicate ids found" error.

2. One product cost is 1000. It is stored in invoice so once if change the cost of product to 800 then how can i update it automatically into a invoice?

We can achieve this using triggers or through relationship among objects.

3. One company is having some branches and all branches having different departments. So, now I want to display all departments from all branches in a single visualforce page?

Using subquery we can fetch all the required data and we can display it in VF page.

Summer ‘13 Certification Maintenance

The Summer ‘13 product releases will occur on May 17, 2013, June 7, 2013 and June 14, 2013. As a certified professional, you will be responsible for completing the Summer ‘13 release exam(s) in order to maintain your certification credential(s).

The Release Training can also be accessed here:

To learn more about what’s new in the Summer ‘13 release, review the release notes:

Deadlines to Complete Release Exams:

·         Winter ‘13 exams must be completed by Friday, June 28, 2013 (applies to individuals certified in Summer ‘12 or earlier)
·         Spring ’13 exams must be completed by Friday, November 1, 2013 (applies to individuals certified in Winter ’13 or earlier)
·         Summer ‘13 exams must be completed by Friday, February 28, 2014 (applies to individuals certified in Spring ’13 or earlier)

Salesforce Interview questions with answers Part 12

1. Can you please give some information about Implicit and Explicit Invocation of apex?
 
Triggers - Implicit

Javascript remoting - Explicit

2. What is apex test execution?

 
Exectuing apex test classes

3. What is meant by email services in salesforce?

http://infallibletechie.blogspot.com/2012/12/inbound-email-creating-record-using.html

5. How can we know few time based workflows has been fired and some more are still need to fire?

http://infallibletechie.blogspot.com/2013/05/how-can-we-track-which-time-based.html

6. In an apex invocation how many methods that we can write as future annotations?


10

7. How can we track which time based wf's are fired and which are in the queue?

http://infallibletechie.blogspot.com/2013/05/how-can-we-track-which-time-based.html

How can we track which time based workflows are fired and which are in the queue?

To track which time based workflows are fired and which are in the queue, kindly go to Setup --> Monitoring  -> Time Based Workflow.


Advantages of Salesforce CRM

  1. Flexibility
  2. Disaster Recovery
  3. Automatic Software updates
  4. Increased Collaboration
  5. Work from anywhere
  6. Document Control
  7. Security
  8. Environmentally friendly

How to find object type from Salesforce record id?

Sample Code to execute in Developer Console:


  1. Id myId = '0035A00003MuvnuQAB';  
  2. String sObjName = myId.getSObjectType().getDescribe().getName();  
  3. system.debug('Object Name is ' + sObjName);  

Output:


( Or )

Sample Code:

Visualforce page:

  1. <apex:page Controller="sample" sidebar="false" >  
  2.   
  3. <apex:form >  
  4.   
  5.     <apex:pageblock id="pg" >  
  6.   
  7.         <apex:pageblockSection >  
  8.   
  9.             <apex:pageBlockSectionItem >Record Id</apex:pageBlockSectionItem>  
  10.             <apex:pageblockSectionItem ><apex:inputtext value="{!recId}" /></apex:pageblockSectionItem>  
  11.   
  12.         </apex:pageblockSection>  
  13.   
  14.         <apex:pageBlockButtons >  
  15.   
  16.             <apex:commandButton value="Find" action="{!find}" reRender="pg"/>  
  17.   
  18.         </apex:pageBlockButtons>  
  19.   
  20.         <apex:outputText >The object type is : {!objType}</apex:outputText>  
  21.   
  22.     </apex:pageblock>  
  23.   
  24. </apex:form>     
  25.   
  26. </apex:page>  

Apex: Controller:

  1. public with sharing class sample {  
  2.   
  3.     public Id recId {get;set;}  
  4.     public String output {get;set;}  
  5.     public Schema.SObjectType objType {get;set;}  
  6.       
  7.     public void find() {  
  8.   
  9.         objType = recId.getSobjectType();  
  10.         System.debug('Object Type is ' + objType);  
  11.   
  12.     }  
  13.   
  14. }  

Output:



Cheers!!!

Why Salesforce.com?

  1. Easy to use
  2. Easy to set up
  3. Click to customize
  4. No software hassles
  5. Security
  6. Ease of implementation
  7. Ease of administration
  8. Features
  9. Price
  10. Customer Support
Cheers!!!

What is Salesforce.com?

Salesforce.com is a cloud computing and social enterprise software-as-a-service (SaaS) provider based in San Francisco. It was founded in March 1999, in part by former Oracle executive Marc Benioff. Cloud computing is a general term for anything that involves delivering hosted services over the Internet. In the software-as-a-service cloud model, the vendor supplies the hardware infrastructure, the software product and interacts with the user through a front-end portal.

Salesforce.com is a web based CRM tool that helps us to maintain the relationship with the customers.

Salesforce.com is a good example for Cloud computing services.

Salesforce.com uses Multi tenant architecture.

Leaders in cloud computing systems for customer relationship management, CRM, sales, social, call centre, knowledge management software cloud computing. 

Cheers!!!

Visualforce Email Template with custom controller

Apex Controller:

public  class acctTemplt
{
    public Id accountId {get;set;}
    public List<Opportunity> getopptys()
    {
        List<Opportunity> oppty;
        oppty = [SELECT Name, StageName FROM Opportunity WHERE Accountid =: accountId];
        return oppty;
    }
}


Component:

Name:OpptyList

<apex:component controller="acctTemplt" access="global">
    <apex:attribute name="AcctId" type="Id" description="Id of the account" assignTo="{!accountId}"/>
    <table border = "2" cellspacing = "5">
        <tr>
            <td>Opportunity Name</td>
            <td>Opportunity Stage</td>               
        </tr>
        <apex:repeat value="{!opptys}" var="o">
        <tr>
            <td>{!o.Name}</td>
            <td>{!o.StageName}</td>             
        </tr>
        </apex:repeat>       
    </table>
</apex:component>


Visualforce Email template:

<messaging:emailTemplate subject="List of opportunity" recipientType="User" relatedToType="Account">
    <messaging:htmlEmailBody >
    Hi,<br/>
    Below is the list of opportunities for your account {!relatedTo.Name}.<br/><br/>
    <c:OpptyList AcctId="{!relatedTo.Id}" /><br/><br/>
    <b>Regards,</b><br/>
    {!recipient.FirstName}
    </messaging:htmlEmailBody>
</messaging:emailTemplate>


Output:



Cheers!!!

Difference between created, created, and every time it’s edited and created, and any time it’s edited to subsequently meet criteria



created
Evaluate the rule criteria each time a record is created. If the rule criteria is met, run the rule. Ignore all updates to existing records.
With this option, the rule never runs more than once per record.
created, and every time it’s edited
Evaluate the rule criteria each time a record is created or updated. If the rule criteria is met, run the rule.
With this option, the rule repeatedly runs every time a record is edited, as long as the record meets the rule criteria.
Note: We cannot add time-dependent actions to the rule if you select this option.
created, and any time it’s edited to subsequently meet criteria
Evaluate the rule criteria each time a record is created or updated.
  • For a new record, run the rule if the rule criteria is met.
  • For an updated record, run the rule only if the record is changed from not meeting the rule criteria to meeting the rule criteria.
With this option, the rule can run multiple times per record, but it won’t run when the record edits are unrelated to the rule criteria.

If we want to trigger the workflow only when the record is created, we have to use “created”.

If we want to trigger the workflow whenever the record is created or edited even though it has currently met and triggered, we have to use “created, and every time it’s edited”.

If we want to trigger the workflow whenever the record is created or edited and previously it didn’t meet the criteria.