Articles in this section
Server Scripts & Jobs Overview Using Custom Server Scripts in Processes, Workflows, and Approvals Running Custom Background Tasks with Vtiger Server Jobs Writing Code for Server Scripts and Jobs Helper Method for Server Scripts and Jobs - HTTP Request Helper Methods for Server Scripts and Jobs - Vtiger REST API Server Scripts Example - Contact Email Validation and Data Enrichment Server Scripts Example - Update Credit Score of a Contact Server Scripts Example - Calculate Organization Outstanding Invoice Amount Server Scripts Example - Set Case SLA by Created Day Server Jobs Example - Importing Daily Leads from a File Server Jobs Example - Update Stocks Weekly in Warehouse System Server Side Scripts & Jobs User Guide

Helper Method for Server Scripts and Jobs - Debugging

This article describes the Debugging helper method for Server Scripts and Jobs.
A
Abdul Sameer
19 Apr, 2024 - Updated  1 year ago

Debugging Methods

As developers, you need to write multiple variations of code to make sure it works perfectly. Often you print or log data to verify our logic, calculations are perfect. You print a request's response to extract the required information. To help developers print data from code and test their script, debugging methods are provided.

To print any data may it be a Number, String, Array or Object, you can use the log() method.

  • Log method available for logging data in the code.
  • Useful for displaying record details, user data passed to the main method, or HTTP request responses.
  • Logs are shown in the CRM, aiding code writing and validation.
 
Notes:
  • Along with the provided log() method, you can also use javascript’s console methods (console.log, console.debug, console.info, console.warn and console.error).
  • Logs added will be available in output and even in execution logs.


Example
async function main(record, user) {
    try {
        var response = await vtap.macro.http.get(https://www.mywebsite.com’);
        log(response);
    } catch(error) {
        console.error(error);
    }
}
Related articles
Helper Method for Server Scripts and Jobs - HTTP Request Helper Methods for Server Scripts and Jobs - Vtiger REST API Server Scripts & Jobs Overview Using Custom Server Scripts in Processes, Workflows, and Approvals Running Custom Background Tasks with Vtiger Server Jobs
Home Privacy Policy Terms of Service Security Center Policy & Legal Center Contact Us
© Copyright 2025 Vtiger. All rights reserved.
Powered by Vtiger
Facebook Twitter Linkedin Youtube