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.
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.
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
- Not Started
- In Progress
- Pickup Date and Time - Date Time
Step 3: Script the Code
Write the code script in Deluge. To get started:
- Navigate to Setup > Developer Space > Functions > + Create New Function.
- Select the place where the function is to be triggered from and click Next.
- Enter a name and description for the function.
- Write the code.
- Add arguments.
- Save 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:
- Related Lists
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.