Tag Archives: SFDC

How to enable Salesforce Lookup Auto Complete?

Salesforce lookup auto complete is a simple feature, which help a lot for daily works, but many of us may not aware about this feature. In this article, I will demonstrate how enable auto complete feature.
Steps to enable Lookup Auto Complete feature.
Step 1:
Go to Setup | App Setup | Customize | Search | Search Settings.
Step 2:
Scroll down to Lookup Settings and look for objects that you need enable for auto-completion then check Lookup Auto-Completion for the objects. Here in below snapshot I’ve enable lookup auto-complete for Account object.

1

Here is a snapshot of contact entry page, before enable lookup auto completion for Account object, when user type in Account name field, nothing show up. Here Contact is the child object of Account parent object.

2

After enable lookup auto completion in Account object, when user type a character in Account name field, it will show recent record from parent object Account.

3

Note:

  • By default this feature is not enable, admin have to manually enable objects for auto-completion.
  • When a lookup field created, the parent object (not child object) need to enable for auto-lookup.
  • It will catch character in a word start with, and is case-insensitive.
  • It only work for both Master-Detail and Lookup relationship, not for text field or other.
  • It displays suggestions from My Recent Items list (including in recent tab and list view) as you type.

Query Rows & Collection size exceeds maximum limit

Visualforce Page:

<apex:page controller="yourCustomcontroller" readonly="true">  
</apex:page>  

Please note using readonly="true" in Visualforce page, can increase Query Rows & Collection size:

  • Query Rows limits increased from 50001 to 1 million rows.
  • Collection size limits increased from 1001 to 10000.

SCOPE clasue in SOQL

The new USING SCOPE clause for SOQL queries lets you limit results by filterScope.

SELECT column_name FROM table_name USING SCOPE filterScope_value

filterScope_value can take one of the following enumeration values:

  • Everything – All records, for example All Opportunities.
  • Mine – Records owned by the user running the list view, for example My Opportunities.
  • Queue – Records assigned to a queue.
  • Delegated – Records delegated to another user for action: for example, a delegated task. This option is available in API version 17.0 and later.
  • MyTerritory – Records in the territory of the user seeing the list view. This option is available if territory management is enabled for your organization. This option is available in API version 17.0 and later.
  • MyTeamTerritory – Records in the territory of the team of the user seeing the list view. This option is available if territory management is enabled for your organization. This option is available in API version 17.0 and later.
  • Team – Records assigned to a team. This option is available in API version 17.0 and later.

Here is an example:

SELECT Name FROM Account USING SCOPE Mine

Difference between SOQL and SOSL

SOQL(Salesforce Object Query Language):

  • SOQL is a Salesforce Object Query Language, retrieves the records from the database by using SELECT keyword.
  • SOQL is used if we know in which object the data is present.
  • In SOQL we can query data from single object and as well as multiple objects that are related to each other.
  • We can query on all fields of any datatype.
  • We can use SOQL in Triggers and classes.
  • We can perform DML operation on query results.

SOSL(Salesforce Object Search Language):

  • SOSL is a Salesforce Object Search Language, retrieves the records from the database by using the FIND keyword.
  • SOSL is used if we don’t know in which object the data is present.
  • We can retrieve multiple objects and field values efficiently when the objects may or may not be related to each other.
  • We can query only on fields whose data type is text, phone and Email.
  • We can use in classes but not in Triggers.
  • We cannot perform DML operation on search result.