Three years ago, we launched Vtiger’s Application Platform (VTAP), a low-code automation framework, to help businesses further customize their Vtiger CRM instance. With VTAP, developers can write client-side code that runs within the user’s browser to enable client-side customization. However, there are many scenarios where the custom code must run on the server end. With the Server Scripts & Jobs, customers and partners can directly run custom code written in JavaScript on Vtiger servers. This feature paves the way for unlimited automation. Here are a few examples: - Enrich your lead data by fetching information from other sources.
- Periodically import data from external sources to CRM.
- Adjust data in parent records according to child records or vice versa (update outstanding invoice balance in each org).
- Integrate AI-powered custom analysis.
This feature triggers these server-side scripts in two ways: - Server Scripts: These are server-side scripts that execute when a certain action happens. For example, a record is saved or approved/rejected.
- Server Jobs: These are server-side scripts that execute automatically at fixed intervals like hourly, daily, weekly, etc.
Use Case Lets understand how server-side scripting works with a simple example of updating overdue invoice amounts in an Organization record. Requirement: At any point of time, you should be able to see overdue invoice amounts of any organization. Solution: Using Server Scripts, this can be achieved easily. - Whenever an invoice is updated (amount or status change), you trigger a script.
- Using Vtiger’s REST method, you can link all invoices to the invoice’s organization in the script.
- Sum the balance of each invoice.
- Again, using Vtiger’s REST method, update the balance in the Organization’s field.
- This will ensure that the overdue invoice amounts will always be visible in an organization record.
|