Scenarios

Lead Assignment

Objective: To assign mechanics available in the corporation to the customers that require maintenance, in a round-robin manner.

 1Process
Flow
 
 2Pre-requisites
 
 3Script
the Code
 
 4Execute
the Function!
 
 

Step 1: Process Flow

  • Any incoming lead must be assigned automatically to Users (mechanics) in a round-robin pattern.
  • This ensures that all mechanics are assigned an equal number of tasks and avoids the problem of one person being over-burdened with tasks.
  • Once the task is assigned, the lead information must be transferred to the Job Cards module and the record assigned to the same mechanic.
  • Once the job is complete, the mechanic will update the status of the job record to Completed.
  • After the job record status is changed to Completed, the record information from the Job Cards module must be transferred to the Repair Bills module.
  • A face-to-face report session must be scheduled for every Friday.
Pre-requisites →
 1Process
Flow
 
 2Pre-requisites
 
 3Script
the Code
 
 4Execute
the Function!
 
 

Step 2: Pre-requisites

First up, you have to create the necessary custom modules and fields.

Job Cards - Custom Module

  • Customer Name - Lookup (Contacts)
  • Job Card Owner - Lookup (User)
  • Job Card Number - Auto Number
  • Service Date - Date
  • Due Date - Date
  • Registration Number - Single Line
  • Service Status - Status Field
    • Assigned
    • Not Started
    • In Progress
    • Completed
  • Total Cost - Currency
  • Pickup Date and Time - Date Time

Repair Bills - Custom Module

  • Repair Bill Owner - Lookup (User)
  • Repair Bill Invoice Number - Auto Number
  • Subject - Single Line
  • Repair Bill Date - Date
  • Job Card - Lookup (Job Cards)
  • Payment Type - Single Select Picklist
  • Customer Name - Lookup (Contacts)
  • Vehicle Registration Number - Single Line

Set a Permanent Record

You must set a permanent record in the Leads module in order for the round robin method to work. This record acts as a reference point for both the records to be assigned and the users to assign them to.

The subsequent records are assigned according to how you write the code.

← Process FlowScript the Code →
 1Process
Flow
 
 2Pre-requisites
 
 3Script
the Code
 
 4Execute
the Function!
 
 

Step 3: Script the Code

Write the code script in Deluge. To get started:

  1. Navigate to Setup > Developer Space > Functions > + Create New Function.
  2. Select the place where the function is to be triggered from and click Next.
  3. Enter a name and description for the function.
  4. Write the code.
  5. Add arguments.
  6. Save the function.
← Pre-requisitesExecute the Function →
 1Process
Flow
 
 2Pre-requisites
 
 3Script
the Code
 
 4Execute
the Function!
 
 

Execute the Function

As you might have seen while creating the function, the trigger points can be in various different places. They are:

  • Button
  • Automation
  • Schedules
  • Related Lists
  • Standalone

This function works best when created in Automation and used in a workflow. This allows you to set the function to be triggered whenever a lead is created, so that the system would automatically assign them.

You have successfully executed the Function for Lead Assignment. Go back up to check out the Auto-Create Events and Data Transfer across Module scenarios.

← Script the CodeNext Scenario

Still can't find what you're looking for?

Write to us: support@zohocrm.com