Create and manage Assignment rules in Salesforce

Assignment rules are used to automate your organization’s lead generation and support processes.

  • Lead Assignment Rules – Specify how leads are assigned to users or queues as they are created manually, captured from the web, or imported via the lead import wizards.
  • Case Assignment Rules – Determine how cases are assigned to users or put into queues as they are created manually, using Web-to-Case, Email-to-Case, On-Demand Email-to-Case, the Self-Service portal, the Customer Portal, Outlook, or Lotus Notes.

Aim : All the cases created by user ‘jZaa’ should be assigned to ‘Jitendra Yahoo’.

To create this Assignment rule, go to Setup | App Setup | Cases | Assignment Rules and on right hand side click on New.

In first step, give the assignment rule name, lets say name is ‘to jitendra Yahoo’. You may have noted the check box which says “Set this as the active case assignment rule” click on this.

Salesforce Interview Questions – Part 3

20. In Which sequence Trigger and automation rules run in

Ans : The following is the order Salesforce logic is applied to a record.

  1. Old record loaded from database (or initialized for new inserts)
  2. New record values overwrite old values
  3. System Validation Rules
  4. All Apex “before” triggers
  5. Custom Validation Rules
  6. Record saved to database (but not committed)
  7. Record reloaded from database
  8. All Apex “after” triggers
  9. Assignment rules
  10. Auto-response rules
  11. Workflow rules
  12. Escalation rules
  13. Parent Rollup Summary Formula value updated (if present)
  14. Database commit
  15. Post-commit logic (sending email)

Additional notes: There is no way to control the order of execution within each group above.

21. If one object in Salesforce have 2 triggers which runs “before insert”. Is there any way to control the sequence of execution of these triggers?

Ans : has documented that trigger sequence cannot be predefined. As a best practice create one trigger per object and use comment blocks to separate different logic blocks. By having all logic in one trigger you may also be able to optimize on your SOQL queries.

22. How to delete the User from Salesforce?

Ans : As per now, salesforce does not allow to delete any user, however you can deactivate the user.

Read further…

23. How to delete the users data from Salesforce?

Ans : To delete the Users Data go to Setup | Administration Setup | Data Management |  Mass Delete Record, from there select the objects like Account, Lead etc and in criteria select the users name and delete all records of that user related to particular object.

24. How to restrict the user to see any record, lets say opportunity?

Ans : set up opportunity sharing to be private.  If both users are admins or have view all records on opportunity, then that overrides private sharing.

25. What is the difference between and trigger.old in Apex – SFDC?

Ans : :

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.

26. How to restrict any Trigger to fire only once OR how we can avoid repeated or multiple execution of Trigger?


Triggers can fire twice, once before workflows and once after workflows, this is documented at Content/ apex_triggers_order_of_execution.htm:

“The before and after triggers fire one more time only if something needs to be updated. If the fields have already been set to a value, the triggers are not fired again.”


Add a static boolean variable to a class, and check its value within the affected triggers.

public class HelperClass {
   public static boolean firstRun = true;
trigger affectedTrigger on Account (before delete, after delete, after undelete) {
                Trigger.old[0].addError('Before Account Delete Error');

27.  What is difference between WhoId and WhatId in the Data Model of Task ?

Ans :

WhoID refers to people things. So that would be typically a Lead ID or a Contact ID
WhatID refers to object type things. That would typically be an Account ID or an Opportunity ID

Check Data Model of task here

28. Where is the option of the report for the “Custom Object with related object” and what are the condition to generate related reports?
Ans :

If the parent object is the standard object provided by the salesforce like “Account”, “Contact” then the report will be in there section with related custom object.
If both objects are the custom then the report will be in “Other Reports” Sections.

Following are the conditions to get the report of related objects:

  • On both the objects, Reports option must be enable.
  • Both object must be related either using Lookup or Master Detail type of field.

Read this article, to get detailed idea on this topic.

29. How you can provide the User Login (Authentication) in Public sites created by Salesforce.

Answer : We can provide the authentication on public sites using “Customer Portal”.

Roll up Summary fields in Salesforce

To study the Roll up Summary field of salesforce, lets take example from our previous tutorial series

Note : Roll up summary field can only be defined on the master object.

While your formula fields calculate values using fields within a single record, roll-up summary fields calculate values from a set of related records, such as those in a related list. You can create roll-up summary fields that automatically display a value on a master record based on the values of records in a detail record. These detail records must be directly related to the master through a master-detail relationship.

refer this page, to study more about the roll up fields.

The Roll up Summary field is basically of 4 types:

  1. Count
  2. Sum
  3. Min
  4. Max

Step by Step Salesforce Tutorial – Creating Trigger and Test cases – 6 of 6

This is the last tutorial in series and we will see that how to create a Trigger and Test Cases in salesforce.

A trigger is an Apex script that executes before or after specific data manipulation language (DML) events occur, such as before object records are inserted into the database, or after records have been deleted.

Triggers are stored as metadata in A list of all triggers in your organization is located at SetupDevelopApex Triggers. In addition to this list, triggers are associated and stored with specific objects.

To define a trigger:

Step by Step Salesforce Tutorial – Creating Workflow rule – 5 of 6

Workflow is the automation of the following types of actions based on your organization’s processes:

  • Tasks – Assign a new task to a user, role, or record owner.
  • Email Alerts – Send an email to one or more recipients you specify.
  • Field Updates – Update the value of a field on a record.
  • Outbound Messages – Send a secure configurable API message (in XML format) to a designated listener.

For example, workflow can automatically:

  • Assign follow-up tasks to a support rep one week after a case is updated.
  • Send sales management an email alert when a sales rep qualifies a large deal.
  • Change the Owner field on a contract three days before it expires.
  • Trigger an outbound API message to an external HR system to initiate the reimbursement process for an approved expense report.

To create workflow rule, go to App Setup | Workflow & Approvals | Workflow rules and click on new Workflow rule.

Salesforce creating Workflow rule step 1
Salesforce creating Workflow rule step 1

Step 1 in creating workflow rule is selecting the object, on which the workflow will be created.

Step by Step Salesforce Tutorial – Creating Email Template – 4 of 6

This time we will see, how to create email templates in

Create Email Template in Salesforce
Create Email Template in Salesforce

To create email template, go to Personal Setup | Email | My Templates and click on New Template.

Step by Step Salesforce Tutorial – Creating Tab and Validation Rule – 3 of 6

In this tutorial, we are going to create Tab and Validation rules for Automated tuition class registration.

To create Tab go to Setup -> Create -> Tabs -> New Custom object Tabs, and there select object Student.

After creation of tab, we can also customize / edit the page layout.

Edit Page Layout Salesforce
Edit Page Layout Salesforce

As you can see, On Custom tab, Go to Page Layouts section and click on Edit button.

Set Page layout Salesforce
Set Page layout Salesforce

Final look of page is shown in above screen shot.

Creating Validation rule in salesforce:

Now lets have a look in Validation feature of salesforce.

Step by Step Salesforce Tutorial – Creating fields – 2 of 6

In this article we will see, how to create the custom fields in

To proceed further, create one more object named course.

Create Custom object though Salesforce
Create "Course" Custom object though Salesforce

Step by Step Salesforce Tutorial – Creating custom object – 1 of 6 or SFDC is award wining CRM tool and many companies have started using the Salesforce because of flexibility, userfriendly and lots of applications available.


To start with this series, you must have below softwares:

  1. Developer Account of Salesforce
  2. Eclipse with Salesforce Plugin
  3. Internet Connection

One visualforce page as an iframe in another visualforce page –

There may be requirement some times to open one visualforce page into existing page as an iframe.

To achieve this, we can use below lines of code in Visualforce.

<ifram src=”…/MyVFPage?var1= { ! MyVariable1 } &&var2= {  ! MyVariable2 } ” …/>

where { ! MyVariable1 } is custom variable.

to read above parameters in resultant visual force page, we can use:

PageReference pageRef = ApexPages.currentPage();
Map pageMap = pageRef.getParameters();
String var1 = pageMap.get(‘var1‘)