Tag Archives: Salesforce Tips & Tricks

Difference between Custom Objects and Custom Settings

Custom Objects:

  • Custom Objects are custom database tables that allow to store information to your organization.
  • All Custom field types supported.
  • Records are updated by users.
  • Data stored in database.
  • Requires lookup or master-detail relationship to reference from another object.
  • Counts against cross-object reference limit when used in formulas.
  • Custom Objects are SOQL expensive.
  • We can use Page layouts, record types, validation rules, triggers and workflow rules on Custom Objects.

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. We can say Custom Settings are like configuration file that we used to have.
  • Custom Settings support only Checkbox, Currency, Date, Date/Time, Email, Number, Percent, Phone, Text, Text Area, and URL field types.
  • Records are updated by admins or developers.
  • Cached in memory (limited to 2mb).
  • No relationship field required.
  • Not a cross-object reference.
  • Custom Settings are SOQL inexpensive.
  • No Page layouts, record types, validation rules, triggers and workflow rules can be used on Custom Settings.

Difference Between Role & Profile in Salesforce

Profile:

  • A Profile is a collection of settings and permissions that controls the user what they have to do in the application and with access what they have.
  • A profile controls “Object permissions, Field permissions, User permissions, Tab settings, App settings, Apex class access, Visualforce page access, Page layouts, Record Types, Login hours & Login IP ranges.
  • Defining profile for a user is mandatory.

Role:

  • A role controls the level of visibility that users have into your organization’s data. Mainly is going to provide the record level security.
  • Users at any given role level can view, edit, and report on all data owned by or shared with users below them in the hierarchy, unless your organization’s sharing model for an object specifies otherwise.
  • It is not mandatory that a user should have a role.

Important Points to Remember in Salesforce

Important Points to Remember in Salesforce:

  • We can track 20 fields for an object. We can’t track Roll-Up Summary and formula fields. We can’t create Roll-Up Summary field on User object.
  • Capacity of picklist values are 300.
  • Lenght of Check syntax: 4000 characters
  • Length of the formula: 1300 characters. Size of the formula: 5000 bytes
  • Only 10 Roll-Up Summary fields we can create per an object. We can create Roll-Up Summary field on parent object to perform operations on child object.
  • Roll-Up Summary field performs 4 types of operations on child object. They are 1.Count 2.Sum 3.Min 4.Max.
  • We can add 20 components for a dashboard.
  • We can display 1000 records on each visualforce page.
  • PageBlockSectionItem will take only 2 visualforce components.
  • Standard fields are Owner, Name, Created By, Last Modified By, Currency, Division.
  • We can’t create Look-Up or Master-Detail Relationship on User Object.

Salesforce Tips & Tricks

  • If you wanted to query ‘accountId, account.name’ fields in a query just specify ‘account.name’ which will retrieve ‘accountId’ automatically.
  • SOQL query can be ORDER BY 32 fields.
  • SOQL/SOSL statements cannot exceed 10,000 characters.
  • SOQL query can’t run more than 120 seconds.
  • For best performance, SOQL queries must be selective, particularly for queries inside of triggers. To avoid long execution times, non-selective SOQL queries may be terminated by the system. Developers will receive an error message when a non-selective query in a trigger executes against an object that contains more than 100,000 records. To avoid this error, ensure that the query is selective.
  • The maximum number of records that an event report returns for a user who is not a system administrator is 20000; for system administrators is 100000.
  • Inbound Email Services: Maximum Number of Email Messages Processed (Includes limit for On-Demand Email-to-Case) is number of user licenses multiplied by 1000, up to a daily maximum of 1,000,000.
  • Inbound  Email Services: Maximum Size of Email Message (Body and Attachments) is 10 MB.
  • Apex Limit: Maximum number of characters for a class is 1 million.
  • Apex Limit: Maximum number of characters for a trigger is 1 million.
  • Apex Limit: Maximum amount of code used by all Apex code in an organization1 is 3 MB.
  • Apex Limit: Default timeout of callouts (HTTP requests or Web services calls) in a transaction is 10 seconds.
  • Apex Limit: Maximum size of callout request or response (HTTP request or Web services call) is 3 MB.
  • Apex Limit: Maximum SOQL query run time before the transaction can be canceled by Salesforce is 120 seconds.
  • Apex Limit: Maximum number of class and trigger code units in a deployment of Apex is 5,000.
  • Apex Limit: For loop list batch size is 200.