Welcome to Portal

?Unknown\pull-down

Welcome to Zoho Cares

Bienvenido a Soporte de Zoho

Search our knowledge base, ask the community or submit a request.

Schedule Functions

What is the Schedule Function? 

The Schedule Function allows you to execute custom functions based on a specified schedule such as hourly, daily, weekly, or monthly. This feature can be used for recurring actions, like generating monthly reports or sending automated emails to portal users about upcoming public milestones or deadlines without relying on specific events.  

Difference between Custom Function and Schedule Function

A custom function is a software code for automating specific actions or processes. The Schedule Function determines the timing and frequency of when these actions or processes are executed, enabling users to specify intervals.

Use case 

As a project manager, maintaining regular backups of portal data is essential for data security and integrity. Manually exporting backup data can be time-consuming. You can use the Schedule Functions to automate the process of exporting backup data, ensuring regular backups.

To set this up, create a Schedule Function named ProjectDataBackupExport, specify the first execution schedule (e.g., weekly or monthly), choose the Repeat Type, and configure End Conditions and On Holidays behavior as needed. Enter the below Deluge script and customize it to automate the export process and monitor the Schedule Function Logs within Zoho Projects to track.

Deluge Script:


// TODO: Please create a connection for the Zoho Projects service with the scopes "ZohoProjects.portals.READ" to Replace 'xxxxxxxxx' with the connection name. Click this link below to learn how to create the connection.

// https://help.zoho.com/portal/en/kb/projects/integration/connections/articles/connections-23-5-2022#How_to_establish_a_Connection

projectsAPIEndPoint = "https://projectsapi.zoho.com/api/v3";

exportResponse = invokeurl

[

url :projectsAPIEndPoint + "/portal/" + portalId + "/portal_export"

type :POST

connection:"xxxxxxxxx"

];

info exportResponse;

Create Schedule Function 

  1. Click in the upper-right corner.
  2. Navigate to Developer Space > Schedule Functions.
  3. Click Create Schedule Function.
  4. Enter a Function Name, and Description, and set the Arguments.
  5. Set the Scheduled Date and Time for the first execution.
  6. Choose Repeat Types based on your preference.
    1. Once: The Schedule Function will only run once at the specified date and time. No further executions will occur.
    2. Hourly: Choose this if you want your function to run repeatedly at hourly intervals. Specify the desired interval in hours in the Repeat Every field, and the function will execute every 'A' hour (e.g. every 2 hours or every 4 hours).
    3. Daily: Select the number of days between each execution. Choose 1 for daily execution, 2 for every other day, and so on from the Repeat Every field.
    4. Weekly: Define every 'A' week in the Repeat Every field. Select the desired days ('Monday', 'Tuesday', etc.) from the Repeat On field, and the function will run only on those days every 'A' week.
    5. Monthly: Choose every 'A' month from the Repeat Every field. Choose specific dates of the month (e.g., 1st, 15th, etc.) by selecting A specific day from Repeat On field. You can also select to execute the function on the last day of the month, or on the Nth day (e.g., second Friday, third Thursday, last Friday) from Repeat On field.
  7. Specify End Conditions to determine when the Schedule Function will end.
    1. Never: The function will continue to run indefinitely until manually stopped.
    2. On: Specify a specific date (e.g., 12-03-2024) as the final execution date. The function will conclude at the end of the day of the given specific date.
    3. After: Enter the desired number of times the function should run before it stops.
  8. Control how your function behaves on Holidays.
    1. Execute Schedule: The function will run even on holidays.
    2. Skip Schedule: This skips the Schedule Function if a holiday is encountered, and the next cycle begins according to your specified Repeat Types. 
    3. Execute on Previous Working Day: The function will shift its execution to the previous working day.
    4. Execute on Next Working Day: The function will shift its execution to the next working day.
  9. Scroll down and type in your code in the Deluge script editor or drag and drop the parameters available in the left panel of the editor and customize them.
  10. Click Schedule to save and schedule, or click Execute to run the function right away.
  1. The Schedule Function will be skipped (similar to the Skip Schedule option) if the previous working day has already passed the scheduled time. 
  1. The schedule automatically stops upon encountering 10 consecutive holidays or weekends when the holiday behavior is set to Skip Schedule, Execute on Previous Working Day, or Execute on Next Working Day.  

 

Edit Schedule Function 

  1. Click in the upper-right corner.
  2. Navigate to Developer Space > Schedule Functions.
  3. Hover over a Schedule Function and click > Edit.
  4. Make the necessary changes and click Save.
    1. The updated dates must be in the future.
  5. Alternatively, click on the Schedule Function to edit.
 Updating the Schedule Function date reinitiates the schedule for subsequent executions.

Manage Schedule Function   

  1. Click in the upper-right corner.
  2. Navigate to Developer Space > Schedule Functions.
  3. Hover over a Schedule Function and click > Clone to replicate the existing Schedule Function.
  4. Click Delete to remove the Schedule Function.
  5. Click Execute Now to run the Schedule Function instantly.
  6. Turn on/off the toggle under Status to activate/deactivate the Schedule Function.
  7. Hover over the Schedule Function and click View Info to see Last Updated Time, Modified By, Created By, and Created Time.
  8. Click  in the top-right corner and click Logs to check the execution history for the Schedule Functions.
You cannot activate the Schedule Function if the scheduled date has passed or if the specified count has been reached.


Helpful?00
Updated: 5 months ago
Share :