Scenarios

Data Transfer across Modules

Objective: To transfer the information from the Parts and Labor module to the Repair Bills module after the maintenance status has been changed to Completed. Mechanics will change the status of the maintenance and the bills will be created automatically based on the associated customer record.

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

Step 1: Process Flow

  • This scenario is different from the other two scenarios, because the status of the job is not updated in the Job Cards module, but in the Parts and Labor module.
  • Once the mechanics are done with the vehicle service, they change the status of the Job Card to Completed.
  • After the job is completed, the details stored in the Parts and Labor module must be transferred to the Repair Bills module, along with the details in the related lists of the Parts and Labor record.
  • The bills for the service are generated automatically based on the associated Parts and Labor and Job Cards records.
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.

Parts and Labor - Custom Module

  • Customer Name - Lookup (Contacts)
  • Vehicle Name - Lookup (Vehicles - Custom Module)
  • Vehicle Model - Single Line
  • Vehicle Registration Number - Single Line
  • Parts and Labor record Owner - Lookup (User)
  • Service Summary - Related List (Products module)
    • General Service Labor (Record from the Products module)
    • Part 1 (Record from the Products module)
    • Part 2 (Record from the Products module), etc.
  • Service Status - Status Field
    • Assigned
    • Not Started
    • In Progress
    • Completed
  • Pickup Date and Time - Date Time
← 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 every Friday morning, or whenever you prefer.

You have successfully executed the functions that achieve the necessary requirements of Zylker. In addition to the above scenarios, you can play around with the functions feature and achieve a lot more.

Furthermore, functions also serve as an FaaS platform (Function-as-a-Service). Hence, you can create robust and dynamic applications that run without the servers.

This marks the end of the Functions Tutorial.

← Script the CodeNext Scenario

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

Write to us: support@zohocrm.com