ioi Script Scheduler

Mise à jour le 18 septembre 2026·

→ Checking and running scheduled background scripts.

Introduction #

This tool is designed to address very specific needs. It allows checking whether it is necessary to execute a script to modify data. This tool is strictly reserved for ioi experts.

Warning #

Using this tool can compromise data consistency and cause locks, errors, or flow interruptions.\n**You assume full responsibility for its use.**

Before using it in a production environment:

  • Test your scripts in a sandbox environment
  • Check data and process consistency
  • Make a complete backup
  • Inform users of a possible data restoration plan in case of error

Attention

High risk warning: SQL scripts may not comply with the consistency rules or business logic defined in the framework.

Creating a Scheduled Script #

Basic Information #

  • Create a scheduled script in ioi

  • A description is mandatory

  • Define the execution frequency:

    • On a specific date
    • On a specific day of the week
    • On a specific day of the month
  • Define Execution Time

  • The Is running checkbox indicates if a background process is currently active

  • The Reset button resets the execution status

Astuce

Only use it if the server was shut down during script execution.

Pre-execution Check #

Define whether a condition must be verified before the script runs.\nThis check can be:

  • Disabled
  • Defined in Python
  • Defined in SQL

SQL Mode #

If the result of the query is not null, the script will be executed.

Example:

SELECT name FROM `tabioi Customer` WHERE country_id = 'BE' LIMIT 1;

Python Mode #

If the ret_value variable (mandatory) equals 1, the script will be executed.

\nExemple :

ret_value = 0

sql = "SELECT name FROM `tabioi Customer` WHERE country_id = 'BE' LIMIT 1"

res = frappe.db.sql(sql)

if res:

    ret_value = 1

Script to Execute #

The script can be written in either Python or SQL, depending on your needs.

Testing Your Script #

Click the Verify button.

How the Test Works #

The script is executed fully, but a rollback is performed at the end of the process.\nThis approach allows you to detect potential errors without impacting actual data.

Attention

Do not include any commit statements in the test script.

Immediate Execution #

The Launch now button allows you to immediately run the script, bypassing the date or periodicity conditions.

Use this feature to test your script in a sandbox environment.

Cette page vous a-t-elle aidé ?